Conditions are a set of guidelines to evaluate the value in the merge field based on which you determine what to show on the merged document after running the merge.
How to insert a condition?
We'll walk you through the process with a simple example. Let's say we are sending a welcome email to new members. Our welcome email has dynamic fields and if the value in the field - Membership type is Regular, the letter has to say "From now on, you get to enjoy unlimited services and benefits at just INR 250 per annum across Zylker!"
If the field value is Student, it has to say "From now on, you get to enjoy unlimited services and benefits at just INR 125 per annum across Zylker!"
Create a merge template. Click here
to learn how. Insert necessary fields. To learn in detail about fields, refer help
Step 2: Click Condition under Advanced Merge Fields. A pop up follows.
Step 3: Select the field from the dropdown list for which you want to set a condition.
Step 4: Select the field type and a conditional operator. If the chosen field contains a date, set the field type to date and configure date format.
Ensure that you choose the same date format as used in the data source. We've explained how conditions with date-type field work in detail here
Step 5: Enter any text or value. The entered value acts as the criteria based on which the condition is evaluated. Please look at the given example.
Conditions for subforms
Generally, when you insert conditions, only the main fields are listed in the dropdown. For the subform fields to be listed, place the cursor anywhere on the subform region and then click Condition.
Show/hide table rows using conditions
With row conditions, you can show or hide a particular row on a table based on any logic. If a condition is not fulfilled, you can hide an entire row from the table. Let's see how to do this with an example. Zylker Pastries offers a 20% cash discount for products above INR 500 using row conditions. Refer the following steps to learn how.
Step 1: Create a merge template with multiple table rows.
Step 2: Place the cursor in the table cell where you want to apply this condition. In this example, the table row with Discount is where the condition should be applied.
Step 3: Now click Condition under "Advanced Merge Fields". In the pop up, check Row condition. Specify your condition and click Insert.
In the below preview, the first bill contains a product which costs more than INR 500 and therefore is eligible for a discount whereas the other bill contains a product which is less than INR 500 and therefore, no discount is availed.
Edit / Delete row condition
To edit or delete the row condition that has been inserted, right click the table cell in which it has been inserted.
- Choosing Edit Row Condition opens a pop-up where you can make changes to the inserted condition.
- To delete a condition click Remove Row Condition.