Zapier Recipes: Conditionally create documents from different templates with branching action pathways
If creating different types of documents is part of your workflow, consider using Zapier to automatically generate them with conditional logic. Using Paths by Zapier, you can tell your zap to create different documents depending on data from the Trigger step.
There are many workflows that could leverage this automation through Zapier but here are a few examples:
- Send an onboarding/welcome packet to a new hire that is specific to their department when an offer letter is signed
- Send different documents at each deal stage in your CRM
- Send different documents depending on the responses in a questionnaire/survey
In this guide, we’ll make a Zap for the onboarding use case; create department-specific onboarding documents for new hires when they sign an offer letter.
Requirements
PandaDoc - Business or Enterprise
Zapier - Professional Plan
Trigger Step
For each step in Zapier, you must select an "Application" and "Event." In this case, the application is PandaDoc and the event is when an offer letter document is completed. Data entered on the offer letter document will be used to conditionally create the document appropriate to their department.
- The conditions that determine which document is created must be included in the Trigger step. In this example, the data is included in a document. It can also come from another application.
In the trigger settings, search for PandaDoc and select the Document completed event. Click continue to connect your PandaDoc account.
Under ‘Set up trigger’, select ‘Template’ as your source, and a second dropdown will appear that lists the available templates in your workspace. Here you will specify which template will trigger the Zap. When you’re ready, click continue.
Why do I need to specify a template?
There are two reasons:
- Control when the automation occurs
When no template is selected, the Zap will try to create an onboarding document when any document in the connected PandaDoc account is completed.
When a template is specified, an invoice will only be generated when documents created from the specified template are completed.
- To pass document specific data through Zapier
When no template is selected, you’ll be able to send only general PandaDoc document data through Zapier and into the ‘Action’ steps.
If you select a template, you can pass all the data available in the document: variables, fields, pricing tables, metadata.
Testing your trigger
Now you will be prompted to test the Trigger step you’ve just created. Before going any further in Zapier, navigate to PandaDoc and make sure there is a completed document that was created from your selected template. The test is looking for a completed document in your workspace so there needs to be a document that meets those conditions that it can find.
If needed, create a test document from your template and complete it. You can speed this part up a bit by manually setting the document status to completed.
After making sure you have a test document, go ahead and test the trigger. If configured correctly, it will return the data from your test document.
- If there are multiple documents that meet the trigger criteria they will all be returned during this test. You can view the returned data from the different documents by selecting them from the dropdown menu (titled Document A, Document B, etc).
Action Step: Conditionally create onboarding documents based on the new hire’s department
With Paths by Zapier, you can configure a zap that can perform completely separate actions from one trigger step. Path A and Path B represent two possible Actions the Zap might take depending on conditions that we’re about to define.
You can find a detailed guide on the full functionality of Paths by Zapier here.
Set Conditions with Paths by Zapier
Create an action step and select Paths by Zapier as the application and you’ll get a description of Paths in the main editor, along with new A and B options.
With Paths by Zapier, you can configure a zap that can perform completely separate actions from one trigger step. Path A and Path B represent two possible Actions the Zap might take depending on conditions that we’re about to define.
Click on the Edit button next to one of the paths and give it a name - something that will help you remember what this path does and why it's different from the others.
Continue to ‘Rules setup & testing’ where you’ll set the conditions that determine when this particular path runs.
In this path, anytime an offer letter is completed Zapier will check the value entered in the [New Hire.Department] and continue only if the Department value is Marketing. Click continue to test.
Click continue to test the condition. It will determine if this path would stop or continue using the sample data from your test document. Since this test document was for a new hire joining the Marketing department, this path would have continued.
Repeat these steps to create conditions for the rest of your paths. This next path will only continue if the new hire is joining the IT team.
Again, since our test data says ‘Marketing’, this path would not have continued.
After you’ve set your conditions it should look something like this:
Now you can set up the final step of this Zap; creating the new hire onboarding packet.
Create Onboarding Document
Now that the conditions are set, we want to take data from the Offer Letter document and populate it into the onboarding document. You may populate any information from the trigger step. In this case, we’ll populate these variables:
- New Hire Title
- New Hire Name
- Start Date
Open one of your paths, and continue to the action setup menu, select PandaDoc as the application, and ‘create document’ as the action. Connect your account and continue to set up.
Here you can specify the document name using plain text (static) or merge fields from the previous step (dynamic).
Specify which template is used to create the document. Make sure that you select the template that matches the conditions you’ve just created. Here we are setting up the onboarding document for the Marketing department.
You may optionally choose to automatically send the document or create it as a draft.
Next, map the data from the Trigger step to populate recipients and variables/fields on the document.
- Why use the ‘Signature Assignee’ token instead of ‘Recipients Email’?
PandaDoc recipients data is passed in an array, meaning the data for all recipients on the document are included in the ‘Recipients’ merge field. Take a look at the screenshot below for an example. There are two recipients on the document, Maria and Austin. You’ll see the ‘Recipients’ fields list the data for both recipients.
If there is only one recipient on the document the ‘Recipients’ field type will work fine. If there are multiple recipients, the best way to pass an email of a specific recipient is to use the “Field assignee” field, which contains the email address of the recipient assigned to the field.
After mapping the document data continue to test the action step. A new document will be created in PandaDoc using the sample data from our test. Head back over to PandaDoc and take a look at the document to make sure the information was pulled correctly.
Repeat the ‘Create Document’ Action setup for each path with the template you’d like to use that aligns with that path’s conditions. When all paths have been successfully tested you’re ready to turn on your Zap and begin automating your document creation!
Please sign in to leave a comment.
Comments
0 comments