BRYTER enables you to create sophisticated and sometimes complex solutions to business problems. As your solution becomes more sophisticated, your modules become more complex, and document generation becomes prone to errors in function and/or style.
Unintended consequences of this complexity include documents that have missing paragraph indents, incorrectly numbered headings, and multiple difficult-to-maintain templates.
Here is an example of incorrectly numbered headings, that are a consequence of deleting a line with a {{\dl}} tag. The end user did not select the "pets" section when they answered. Consequently, the paragraph numbering jumped from paragraph 22 to paragraph 24.
If you need to conditionally display individual lines rather than entire paragraphs, consider using variants, as they are specifically designed for inline use (though they can span multiple lines without line breaks).
Conditional content tags
Conditional content tags in a template show or hide sections of a document based on end user responses meeting a specific condition.
Indicate the beginning of conditional content by placing an {{\if condition_name}} tag in the line directly above the document section (replace "condition_name" with your condition’s name).
Indicate the end of conditional content by placing an {{\endif condition_name}} tag in the line directly below the document section. The tags must be stacked above and below the conditional text.
The text in-between these two tags will display when the (number) variable mapped to condition_name takes the value 1. The text will not display when the variable takes the value 0. Mapping a variable to a condition is done in the TEMPLATE PLACEHOLDERS section of the Create Document action.
This image illustrates the transition from template to generated document. Section 22 in the template, PETS, was skipped by the user when responding to questions . Consequently, the number variable associated with pets took the value 0 and the PETS section was hidden in the generated document. Numbering in the generated document was sequential — the PETS section is not relevant to this end user’s version of the document.
Example 1
Often you want to include a certain text in your generated document whenever an end user chooses a certain Single Select Option.
For example, you may want to include a clause on pets in your document whenever the end user confirms to have a pet.
Here is how to proceed:
- Prepare your template document with the pet clause as conditional content.
- Create a Single Select input asking "Do you have a pet?".
-
Assign the value 1 to the answer option "Yes" and the value 0 to "No".
- Upload your template document in a Create Document action and assign the values generated by the "Pets"-Node to the condition "pets".
Example 2
In some cases, the condition when to display conditional content might depend on more than one end user answer.
For example, you might want to show the clause on pets if the end user has a pet, but you do not want to show it if the end user is a veterinarian.
To achieve this, we will use number values to mock a condition: A number value of 0 will mean false, and a number value of 1 will mean true. Here is how to proceed:
- Prepare your template document with the pet clause as conditional content.
- Create a Number value node and assign the value 0 (for false). Call the node "Show pet clause?" This will become the condition variable for your conditional content.
- Add a Single Select input asking "Do you have a pet?" and another one asking "Are you a veterinarian?"
- Add a Number value node and also name it "Show pet clause?" to update your condition variable. Set the value to 1 (for true).
- On the transition leading to "Show pet clause?", add your condition: The clause should be shown if the variable "Pet?" is answered with "Yes" and the variable "Veterinarian?" is answered with "No". Add an another transition from “Veterinarian?” that will be followed whenever this condition does not apply.
With this structure, we set "Show pet clause?" to 1 when the end user has a pet and is not a veterinarian. We keep it at 0 otherwise. - Upload your template document in a Create Document action and assign the variable "Show pet clause?" to the condition "pets" from the conditional content in your template document.