Working with Conditions
Table of contents
Conditions let you show different sets of content based on what value a user enters in a particular field. For instance, if the age field in your document must contain a value above 13, you can insert a condition for it.
When a number above 13 is entered, the condition is fulfilled and a text of your choice appears on the screen. On the other hand, when the value is lesser than 13, the condition is not fulfilled and again a text of your choice will be displayed.
- Click Condition under 'Advanced Fields'.
- Select the field for which you want to set up condition(s) from the dropdown list.
- Select a condition from the dropdown list.
- Specify the condition here and click Insert.
- You can see the condition that has been set up in the document as shown and you can add the necessary content to be displayed.
Note: Only the fields which you have labelled will appear in the dropdown list.
Check out the following video where we have explained how to insert a condition with an example.
Generally, when you insert conditions, only the main fields are shown in the dropdown list.
If your merge document requires inserting conditions in subforms, follow these steps for the subform fields to be listed in the Insert condition dialog box:
- Place the cursor anywhere on the subform region and click conditions.
- You can now see all the subform fields listed.
- Specify your condition and click Insert.
With row conditions, you can show or hide a particular row in a table based on a logic. In other words, when a condition is not fulfilled, one entire row from the table is hidden.
A store that wants to offer a cash discount for a particular type of product or for a particular price range, can do it with the aid of row conditions.
Let us see how this can be done with an example.
Zylker Pastries wants to offer a 20% cash discount for products purchased above INR 500 using row conditions.
- Create a template according to your requirements.
- Place the cursor in the table cell where you want to apply this condition.
- Now click conditions under "Advanced Merge Fields".
- The following dialog box opens.
- Check Row condition. Specify your condition and click Insert.
- You can edit or delete the row condition that has been inserted by right clicking the table cell in which it has been inserted.
- Click Save & Proceed.
- Preview the merge after inserting a row condition.
In this example, the table row with Discount is where the condition should be applied.
In the above preview, the first bill contains "red velvet cake" which costs more than INR 500 and therefore is eligible for a discount whereas the other bill contains a product that costs less than INR 500 and hence no discount can be availed.