Mitech Preloader

Conditional processing – If, Else, When

User Reference

Conditional processing – If, Else, When

Text can be included in or excluded from the merged document depending on the value of data in the data set. This can also be referred to as Document Logic.

 

If command:

Example 1:

Suppose special wording is required when the BalanceOutstanding is greater than $10000; the If command would be used like this:

We note that your account is overdrawn by an amount of $«FormatNumber(BalanceOutstanding)». Please ensure that this amount is paid to us within 48 hours«If(BalanceOutstanding > 10000)» failing which you will be handed over to our attorneys«End()».

Example 2:

Suppose different questions need to be asked if the Entity is an Individual:

«ChooseFromRDBList(Entity_Type,Individual,Corporate)»
«If(Entity_Type = 'Individual')»
«First_Name» «Last_Name»
«End()»

Note that in these two scenarios, when the If statement is comparing a data element to text that text should be in quotes. But when the data element is being compared to a number, no quotes are required.

 

Else command:

The Else() command can be used in conjunction with If:

The document must also be signed by «If(PartyType = 'Minor')»the legal guardian«Else()»the party’s marital partner«End()».

 

When command:

The When command can be used when the text to be included or excluded is small, is text only (i.e. contains no further data elements) and requires no MS Word formatting.

Example 1: Adding an ‘s’ to pluralize:

This fax consists of «NumberOfPages» page«When(NumberOfPages != 1,s)».

Note that != means “not equal to”.

 

Example 2: Using pronouns:

If appropriate, «When(Gender = "Male",he,she)» will be required to use public transport to get to work.

 

Example 3: Using the correct plural and possessive nouns in the context of repeating data

«When(count(Plaintiff) > 1,Plaintiffs are,Plaintiff is)»

«When(count(Plaintiff) > 1,Plaintiffs' address,Plaintiff's address)»