Use If/Then/Else statements to automate fields or asks in a document. They're an advanced type of automation but with some training and practice, you can use this feature to create powerful templates.
What is an If/Then/Else statement?
An If/Then/Else statement solves for situations where certain conditions lead to a certain outcome. For example:
- If Condition A is true, then show X.
- If Condition A is false, then show Y.
Smokeball's Precedent Creation/Modification mode helps you build If/Then/Else statements in precedent templates. Below, you'll find some examples of If/Then/Else statements and how to insert them into your documents. Use the Table of Contents on the right-hand side of this article to navigate quickly!
Video guide
Prefer to watch a video? Watch our video guide below:
Add an If / Then / Else statement to a document
- Open a matter, then select Precedent from the Matter tab. Then, select Add a precedent and create a new precedent. The left panel is referred to as the Precedent Creation/Modification mode.
- Ensure your 'Show' button is set to 'Show Fields'
- Click on the If / Then / Else tab
- Select whether the If / Then / Else is dependent on an Automation Field or Ask from the If: drop-down
Create an If / Then / Else Dependent on Field Existing
For example: I want to create a variable in my document where if a finance approval due date exists on my Matter I want a paragraph to show, and if there is no finance approval due date on my Matter, I want no information to show
- In this example, expand Conveyancing Details and select the Finance Approval Due Date Automation Field
- From the Is: drop-down select 'Exists'
- Place the cursor at the end of the directly preceding paragraph
- Click Insert
-
Highlight the paragraph that you want to appear if there is a finance approval due date and cut this information
- Delete the word true
-
Paste the paragraph about the finance approval due date where the word true was (in between if then and else)
-
Delete the word false (in between else and end if), as there is no information to show if there is no finance approval due date
- 'End If' indicates the end of the variable and should be included after the information you want to show if there is no finance approval due date
Create an If / Then / Else Dependent on Field Equalling
For example: I want to create a variable in my document where if 'Nature of Property' equals 'Residential Vacant Land' I want a paragraph to show about vacant land and if the 'Nature of Property' is equal to anything else, I want a paragraph about final inspections to show
- In this example, expand Property Details and select the Nature of Property Automation Field
- From the Is: drop-down select 'Equal'
- In the Equal box, type 'Residential Vacant Land' exactly as it is worded and formatted in the Property Details window of the matter
-
Place the cursor at the end of the directly preceding paragraph
- Click Insert
-
Highlight the paragraph that you want to appear if the property is Residential Vacant Land and cut this information
- Delete the word true
-
Paste the paragraph about Residential Vacant Land where the word true was (in between if then and else)
-
Highlight the paragraph that you want to appear if the property is anything other than Residential Vacant Land and cut this information
-
Delete the word false
-
Paste the paragraph about anything other than Residential Vacant Land where the word false was (in between else and end if)
- 'End if' indicates the end of the variable and should be included after the information you want to show if it is not Residential Vacant Land
If / Then / Else Dependent on Greater Than Or Equal
For example: I want to create a variable in my document if the Purchase Price is equal to or greater than $750,000.00 I want a paragraph to show about Capital Gains Withholding, and if the Purchase Price is less than $750,000.00 I want no information to show
- In this example, expand Conveyancing Details and select the Purchase Price Automation Field
- From the Is: drop-down select 'Greater Than Or Equal'
- In the Greater Than or Equal box type '750,000.00' exactly as it is worded and formatted in the Conveyancing Details window of the matter
-
Place the cursor at the end of the directly preceding paragraph
- Click Insert
-
Highlight the paragraph that you want to appear if the property is equal to or greater than $750,000.00 and cut this information
- Delete the word true
-
Paste the paragraph about Capital Gains Withholding where the word true was (in between if then and else)
-
Delete the word false, as there is no information to show if the purchase price is less than $750,000.00
- 'End If' indicates the end of the variable and should be included after the information you want to show if the purchase price is equal to or greater than $750,000.00
Create an If / Then / Else Dependent on Ask
For example, I want to create a variable in my document dependent on a custom field or Ask, such as if there is an Easement on the property I want a paragraph to show about Easements and if there is no Easement on the property I want no information to show
- In this example, you will first need to create an Ask
- From the If: drop-down select 'Ask'
- Select the relevant Ask
- From the Is: drop-down select 'Equal'
- In the Equal box, type 'Yes' exactly as it is worded and formatted in the Ask
-
Place the cursor at the end of the directly preceding paragraph
- Click Insert
-
Highlight the paragraph that you want to appear if there is an Easement on the property and cut this information
- Delete the word true
-
Paste the paragraph about Easements where the word true was (in between if then and else)
-
Delete the world false, as there is no information to show if there is no Easement on the property
- 'End if' indicates the end of the variable and should be included after the information you want to show if there is no Easement on the property.
Identifying errors in If/Then/Else statements
If/Then/Else statements can become complicated, especially when there are several in a single document. If you are running into errors when generating If/Then/Else statements, refer to our troubleshooting guide.