Overview
Condition fields allow you to dynamically show or hide content based on set conditions. Conditions come in handy while automating documents like contracts, proposals, or letters where certain sections only apply in specific cases. You can apply conditions to text blocks, table rows and subform regions.
Prerequisites
- An Automation template connected to a data source with necessary fields involved in conditions to be added to the template (e.g., Name, Membership Type)
Steps
A. Add conditions to text blocks
- Go to Automate Tabb, Click Condition under the Advanced Merge Fields section
- In the popup Edit Text Conditions
- Choose the field .
- Choose the operator (equals).
- Enter the value to match (e.g., “Regular”).
- Click Insert to place the if-else block in the document,
- You'll now see two placeholders: <<IF block>> and optionally <<ELSE block>> as shown
- Hover on the sample text in IF block "content to be shown if the condition is true"and type the required text to conditionally display your content. Similarly hover on Else block sample text "content to be shown otherwise" and type content to be placed in Else block.
B. Add conditions to show or hide table rows
- Place the cursor inside the table row you want to conditionally show or hide.
- Click Condition under Advanced Merge Fields.
- In the popup:
- Click Insert Row Condition.
- Define the condition using the visual builder:
- Click Insert. Here's an image showing a row condition:
C. Remove Text or Row Conditions
- To edit or delete the row condition: Right-click the row > Edit or Remove Row Condition.
- To delete text condition in blocks, select condition block as shown and press delete
Troubleshooting
1. Error/Symptom: The condition dialog condition shows options for text fields, but not for date fields.
Possible Cause: Field type might not be configured as Date.
Recommended Solution: Make sure the field type is correct in merge settings.
2. Error/Symptom: Checkbox field condition is not working.
Possible Cause: The value received for the checkbox might not match the expected configuration.
Recommended Solution: Verify the actual value returned for the checkbox field. It may be 'true', 'TRUE', or 'checked', depending on the data source. Ensure the condition matches this value exactly.
3. Error/Symptom: Condition doesn't work / content not showing.
Possible Cause: Field value could be missing in the data source.
Recommended Solution: Make sure the field referenced in the condition has a valid value for each record.
4. Error/Symptom: The table row doesn’t appear even if the condition is true.
Possible Cause: The row condition may be set incorrectly or applied to the wrong row.
Recommended Solution: Right-click the row, choose Edit Row Condition, and verify the condition.
5. Error/Symptom: Subform fields are not listed in the condition builder.
Possible Cause: Cursor could be placed outside the subform repeat region.
Recommended Solution: Click inside the subform region before opening the condition popup.
6. Error/Symptom: Date condition is not working
Possible Cause: Mismatch between the date format in the condition and data source.
Recommended Solution: Ensure the field type is set to Date in the condition popup, and match the date format (e.g., dd/mm/yyyy
, mm/dd/yyyy
) exactly with your data source.
7. Error/Symptom: Condition inside Repeat/Subform block doesn’t work.
Possible Cause: Field used in the condition is outside the block's scope.
Recommended Solution: Use only fields available within the subform or repeat block when defining the condition.
8. Error/Symptom: I can’t hide the subform table heading when subform table is empty; Merge Preferences only hides the subform table.
Workaround: Add a row with table header as part of repeat table and set merge preference as "Do not Show Table, if all rows are empty"
9. Error/Symptom: Unable to simulate else-if in conditions.
Possible Cause: Zoho Writer does not support else-if directly.
Recommended Solution: Create multiple independent if-else blocks with mutually exclusive conditions as shown:
If Client_Type == "Premium"
Show: "Welcome, Premium Client!"
Else
If Client_Type == "Basic"
Show: "Please consider upgrading to Premium."
Else
Show: "Hello, Guest! Sign up today."
Related Articles & Videos
- Watch : Using Conditions in Merge Template
- How to use date based conditions in Writer