Fixing automation errors in If/Then/Else statements

Available on Smokeball Grow and Prosper+

We have outlined some common error messages that could occur when generating If/Then/Else statements in a document or from creating your own. Use this article to start troubleshooting.

Error message: ‘An error has been found in an If/Then/Else in this document’

blobid0.png

If you receive an error while generating a precedent, the cursor will move to the location of the error. To fix the issue, compare the precedent’s error location to the template (in modify mode) and use the information in this article to diagnose and fix the problem.

If you added an If/Then/Else code to a template, but it is not working, you need to understand the different elements of the code to diagnose and fix the issue. Every If/Then/Else statement should include the following tags:

  1. <<IF (xy) THEN>>
  2. <<ELSE>>
  3. <<END IF>>

If any of the tags are missing from the statement it will not work, and you will need to recreate it from the Smokeball toolbar.

Remember, all automation is based on the data fields in the matter file. It is important to understand the distinct types of data that may be entered into the matter file and account for them in your if/then/else statement.

Learn more about creating various if/then/else statements and their data logic.

Embedded If/Then/Else statements

If you are using If/Then/Else statements within other If/Then/Else statements, it is important to make sure you have the same number of <<IF THEN>>, <<ELSE>>, and <<END IF>> tags. This ensures your code is properly formatted and will function as intended. If the number of tags is not equal, the statement will not work.

You may be able to identify the error by the statement's colour. If the entire embedded statement was created in a single edit session, each singular statement should be a distinct colour. If a statement of one colour is missing a tag, simply remove the statement and re-insert it.

If you cannot identify the statement that contains the error, you will need to recreate the entire embedded statement from the toolbar.

Troubleshooting If/Then/Else statements based on an Ask

If you edit an If/Then/Else statement (including embedded) based on an Ask, there are process steps to consider.

Ensure that you:

  1. Add the new answer to the Ask automation.
  2. Account for the new (case-sensitive) answer in the statement.

If you miss either of the above steps, the edited statement will not work.

To add or edit options in existing Ask automation:

  1. View the precedent template (or container) in Modify
  2. Go to the Ask heading in the Smokeball toolbar.
  3. Right-click the existing Ask and select Edit.
    blobid1.png
  4. Add the new option and click Save.

Learn more about creating an If/Then/Else statement based on an Ask.

Troubleshooting If/Then/Else statements with paragraph numbering

There are two important things to remember when creating If/Then/Else statements containing paragraph numbering. 1) Tick Contains paragraph numbering before inserting the statement into the template, and; 2) each component of the statement must be on a separate line.

So, make sure to tick the below:

blobid2.png

Spread out your statement on the template with the following structure:

Line 1: <<IF (xy) THEN>>

Line 2: Content

Line 3: <<ELSE>>

Line 4: Content

Line 5: <<END IF>>

For example:

blobid3.png

Next steps

If you are unable to identify and fix the error, you have two options:

  1. Redo all the If/Then/Else statements from scratch.
  2. Revert the document to a previous working version and continue editing from there.

Learn more about reverting to a previous version and creating If/Then/Else statements.

Was this article helpful?
0 out of 0 found this helpful

Articles in this section