Using the If command, chunks of text can be included in or excluded from the assembled document depending on values provided by the user in the interview.
Command structure:
«If(Balance_Outstanding > 10000)»
«If(Beneficiary = 'Yes')»
Examples of usage:
Suppose special wording is required when the Balance_Outstanding is greater than $10000; the If command would be used like this:
We note that your account is overdrawn by an amount of $«FormatNumber(Balance_Outstanding»)
. Please ensure that this amount is paid to us within 48 hours«If(Balance_Outstanding > 10000)»
failing which you will be handed over to our attorneys«End()»
.
Note:
- The If command needs to be accompanied by an End command to mark the end of the text which is being included or excluded.
- There is no need to apply include and exclude commands to one clause; one command i.e. the If command, would determine whether the clause or even an entire template should be included or not.
- When comparing to an amount, no quotes are needed around the amount.
«If(Balance_Outstanding > 10000)»
- When comparing to text, quotes are needed around the text string.
«If(Beneficiary = 'Yes')»
- ‘Not equal to’ is written like this: != e.g.
«If(Marital_Status != 'Unmarried')»
Further examples:
Combine more than one condition in one If statement:
«If(Deposit_Payable = 'Yes' and Balance_Outstanding > 10000)»
- Note the lower case ‘and’.
- Using ‘or’ would be the same – always a lower case ‘or’.