In addition to the standard variables available in Builder, you can also use instructions to alter text in the completed document. An instruction is a command used to tell Builder to perform a specific task within your template. For example, if you have a section of text that should only be used when a certain condition exists, you can use an if instruction, or if you want to insert a list of data rather than just a single piece of data, you can use a list instruction.
Like variables, if and list instruction fields must be enclosed between curly and square brackets. Additionally, it matters where you place your opening and closing instructions. If the opening instruction is on its own line, the closing instruction must likewise be on its own line. If the opening instruction is within a paragraph, the closing instruction must also be in the same paragraph. (In these instances, a line refers to the space between Word paragraph markers.) The following example showcases these concepts:
If you are inserting a variable that's part of a participant type object model (which are lists), once you insert the variable, you'll need to manually update the field so that Builder knows which specific record from the list should be inserted. To do this, you'll need to do two things: 1) add the object model name to the variable field, and 2) add a marker that indicates which record you want to use.
So, for example, if you add this if instruction and variable:
{[if MailingAddressLine2]}
{[MailingAddressLine2]}
{[endif]}
You will need to manually change the field to look like this, based on the name of the object variable the variables are a part of:
{[if pt_Client[0].MailingAddressLine2]}
{[pt_Client[0].MailingAddressLine2]}
{[endif]}
In this example, pt_Client refers to the name of the object model, while [0] indicates you want to use the data for the first respondent in the record. In Builder, indexing starts at 0, which means if you want the first party in the list, enter a [0].
Using If Instructions
If instructions can be used with all variable types.
If Instruction | Explanation |
Address: {[Employee.AddressLine1]} {[if Employee.AddressLine2]} {[Employee.AddressLine2]} {[endif]} {[Employee.City]}, {[Employee.State.Abbrev]} {[Employee.ZipCode]} | Here, if the user enters an Address Line 2 (a text variable) during the intake, it will be merged in the document. If they do not, this field will not be used in the completed document. |
{[if BenefitsPackage]} Benefits The employer offers the following benefits: {[Available_Selections.Benefits]}. Access to these benefits occurs after the probationary period. {[else]} Benefits {[Employee.Name]} is not eligible to receive benefits. {[endif]} | In this example, if the BenefitsPackage true/false variable is selected, a paragraph that lists the available benefits is included. Otherwise, a different paragraph is added that indicates the employee does not qualify for benefits. |
{[if Available_Selections.Benefits == "Basic"]} Basic Benefits package includes health and life insurance. {[elseif Available_Selections.Benefits == "Standard"]} Standard Benefits package includes health, dental, life, and short-term insurance. {[elseif Available_Selections.Benefits == "Premium"]} Premium Benefits package includes health, dental, vision, life, short-term, long-term, and pet insurance. {[endif]} | In this example, whichever option from a selection variable the user selects determines which paragraph is inserted in the document. |
To insert an if instruction:
- Edit your Builder template. See Editing a Builder Template File.
- In the template, select the text you want to make conditional.
- In the Word Designer pane, find the variable you want to use in the condition.
- Click the ellipses icon to the right of the variable name and choose Insert content with if statements to Document.
- If you are using a text, date, or number variable, the variable field is inserted in the document between the opening and closing if instruction fields.
- If you are using a true/false variable, a window appears asking you additional questions about what you are trying to do. Click the drop-down to choose whether you want the variable to be true (Is or Is Not). Then select whether you want to include another possible true/false scenario by selecting Include Else. Then click Insert.
- If you are using a selection variable, a window appears asking you additional questions about what you are trying to do. Click the first drop-down to choose whether you want the variable to equal to or not equal to (Is or Is Not) to the option in the second drop-down list (which corresponds with the options defined in the selection variable). Then select whether you want to include another possible scenario by selecting Include Else. Then click Insert.
- Once the instruction is inserted in the template, you may need to work more with the underlying template text to make sure it’s correctly placed and formatted between the opening and closing instructions.
- Save your changes in your Word template.
Using List Instructions
List-type variables allow you to enter multiple answers for a single question, for example, a list of children or a list of goods and services. A list instruction allows you to format how answers in that list will be merged in the completed document.
To insert a list in the document:
- Edit your Builder template. See Editing a Builder Template File.
- In the template, place your cursor where you want to insert the list.
- In the Word Designer pane, find the list-type variable.TIP: The word list will appear to the right of the entry label.
- Click the ellipses icon to the right of the variable name and choose Insert list to Document. A second list of punctuation options appears.
- Choose how you want the list to be punctuated. The instruction (and related variable) is inserted in the template.
- Once the instruction is inserted in the template, you may need to work more with the underlying template text to make sure it’s correctly placed and formatted between the opening and closing instructions. NOTE: When inserting a list object, only the first variable referenced in the object is inserted in the template. If you need additional or different variables, you’ll need to manually add them between the opening and closing instruction fields. You can do this by expanding the object to view its variables. Then, click the ellipses icon next to the individual variable you want to insert and choose Insert content to Document. This may include manually inserting additional variable fields.
Additionally, remember that it matters where you place your opening and closing instructions. If the opening instruction is on its own line, the closing instruction must likewise be on its own line. If the opening instruction is within a paragraph, the closing instruction must be in the same paragraph. - Save your changes in your Word template.
For more information, see:
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article