With the launch of XpressDox low code, or version 14, the If Block is now available directly from the ribbon. This makes inserting conditional logic really quick and simple.
Open the If Block from the ribbon and notice how all the field names from your template appear in the drop down list available to be selected. When using the Question command to insert new fields, the list of fields will be updated immediately.
Using the If Block to insert a clause:
Option 1: Converting an existing clause in a template into a conditional clause
Suppose in this example, we should ask if there is a Security deposit due, and then if the answer to that question is Yes, include that clause.
- First insert a Question asking whether a Security deposit is due. You can add this at the end of the template to maintain readability of the template. And later use the Manage Interview button to re-sequence fields.
- Select the conditional clause in Word, and then click on the If Block on the XpressDox ribbon.
- Select a field name; Security_deposit_due
- Then select a comparison operator, = (equals)
- And lastly a Value. This is the value to which the field name should be compared to decide if the condition resolves as true or false. The value must be exactly the same as the value you gave when you created your List Question. It is case sensitive. If the value you are entering is a text value it should be enclosed in quotes (single or double, it doesn’t matter, as long as they are the same on both sides).
- Click OK when you’re done.
- Your conditional clause will now be enclosed in an If Block, beginning with an If command and ending with an End command.
- Note that every If command requires an End. And you may want to edit the text inside the End command «End(If)» to make it more descriptive. It can help with troubleshooting your template! «End(If security deposit due is yes)». The text is simply a comment to help you, and is not case sensitive.
Option 2: Using the If Block to insert only the correct commands into the template
- Click on the If Block from the XpressDox ribbon
- Select a field name, a comparison operator and type a value. Then click OK.
- The following commands are inserted into the template, ready for you to add your own text in between.
«If(Payment_type = 'Cash')»
Note once again that every If command requires an End, and that can edit this text «End(If)» to make it more descriptive «End(If payment type is cash)».
What if my field names are not in the drop down list?
If you used the Question command to enter field names, then they will be in the drop down list for you to select from. But if you typed fillpoints into your template, or used the Quick Fillpoint button to enter a fillpoint then your field names will likely not be in the list. But that’s OK! If you want to refresh this list, save your template, head over to the Command Assistant and click this button to refresh the list of fields in the list.
Alternatively, simply type a field name into the If Block. It is not absolutely necessary that you select one from the list.
There is an important point to note on the Question command about the relevance on questions in the interview.
Shown below is an extract from Edit Fillpoint on «Question(Deposit_amount,Deposit amount,Number,,,,,FormatNumber(Deposit_amount,’#,##0.00′),automatic)». When choosing the first option i.e. Inferred from template logic, it means that the question should only be asked in the interview when it needs to be, when the answer to Security_deposit_due is Yes.
Choosing “Always Show” would cause the question Deposit_amount to show even if the answer to Security_deposit_due is No.
Note the other operators in this If Block:
< and > can be manually changed to <= and >= respectively.