This is an advanced article for creating Document Automation templates that use provisional statements. Information technology allows you to create a template which has information that changes based on the values of different merge fields.

For full general assist with Document Automation, see hither:

  • What is Document Automation?
  • Certificate Automation: Creating a Template
  • Certificate Automation: Uploading Templates and Generating Documents

Important Annotation: Due to the order in which MS Word updates fields, templates with conditional statements work all-time when generating PDF documents with Document Automation.  If you desire to utilize your conditional templates to generate MS Discussion documents, delight follow the troubleshooting steps Here.

Contents

Understanding Conditional Statements
     What is a Conditional Statement
     Expressions
     Operator
     TrueText and FalseText
     Putting it all Together
Calculation Conditional Fields to a Word Template
     Limitations and Syntax
Tips and Examples of Useful Conditional Statements
     Using Clio Checkboxes to Determine what is Displayed
     Using Clio Picklists to Make up one's mind what is Displayed
     Nesting Conditional Statements (Multiple Weather condition)
     Adding Line Breaks to TrueText and FalseText
Troubleshooting Document Generation in MS Word

Understanding Conditional Statements in MS Give-and-take

What is a Provisional Statement?

In the most basic language, a provisional statement says that: if some condition is applicable, and so practice something.

Conditional statements follow the general format: IF this THEN that or ELSE some other thing. For case:

  • IF the trust balance is 0, And then display a bulletin request for some other prepayment, ELSE display a thank yous message
  • IF custom_field_1 is true, THEN display custom_field_2, ELSE display custom_field_3

In MS Word, the conditional statement format looks like this:

IF Expression1 Operator Expression2 "TrueText" "FalseText"

Expressions

Expressions are something with a value. In the example of Certificate Automation, a merge field tag tin can exist an expression. A conditional statement has ii Expressions, or values, that are compared in club to decide what data is displayed.

Note that Expressions (or merge field tags) that have a value that is in plainly text demand to be surrounded by quotation marks; only Expressions that accept a numeric value should not exist surrounded by quotation marks.

To indicate that a value is empty (specifically for the second Expression), use ii quotation marks with nothing between them "" in identify of the second Expression.

Examples of Merge Tags with a Text Value
(surroundings these with quotes)

<< Matter.Number >>
<< Matter.Clarification >>
<< Affair.ResponsibleAttorney >>
<< Affair.Client.Name >>

Examples of Merge Tags with a Numeric Value
(practice not surround these with quotes)

<< Matter.TrustBalance >>
<< Matter.OperatingBalance >>
<< Matter.Client.TrustBalance >>
<< Thing.Client.OperatingBalance >>
<< Matter.Client.PaymentProfile.InterestRate >>
<< Affair.Client.PaymentProfile.GracePeriod >>

Operator

The operator defines how the expressions chronicle to each other. For example, are they equal/the same, or not?

= Equal to Utilise with both text and numeric Expressions
<> Not equal to Utilise with both text and numeric Expressions
> Greater than Use with numeric Expressions merely
< Less than Use with numeric Expressions only
>= Greater than or equal to Apply with numeric Expressions merely
<= Less than or equal to Utilise with numeric Expressions simply

TrueText and FalseText

TrueText refers to the text that will be displayed if the condition (relationship between the expressions) is satisfied.

FalseText refers to the text that will be displayed if the status is Not satisfied (this is the ELSE role of the argument).

TrueText and FalseText statements should be surrounded past quotation marks.

If you want either the TrueText or FalseText to be empty (to non display anything), just use empty quotation marks"".

Y'all can also use Clio merge field tags in your TrueText and FalseText.

Putting it all Together

Putting together all of the elements detailed above, a conditional statement that volition display a bulletin request for a prepayment funds if the client's trust rest is zero can look something like this:

For more information on composing conditional statements for use in MS Give-and-take, click Hither.


Adding Conditional Fields to a Discussion Template

To add a conditional field in MS Word, ensure that your text cursor is located in your document where yous desire the conditional text to display, then click on the "Insert" tab and so click on the "Quick Parts" icon in the "Text" group (Newer versions of Word will not have the Quick Parts icon, merely they will have the Field icon) .

In the Quick Parts menu, click on the "Field" choice.

In the "Field" window, scroll through the "Field names" list and select "If". Enter your conditional statement into the "Field codes" text area then click "OK".

In your document, you will probable see the FalseText of your conditional argument. That is because the Discussion document doesn't know the value of your Clio merge field tags before Document Automation takes place. To make fields in your certificate stand out more conspicuously, you can change how fields are displayed in your Word document.

Open the Word Options window by pressing Alt+f+t on your keyboard. In the Options window, click "Avant-garde" from the side panel and then scroll down to the section "Show document content". There are 2 options hither to help you quickly place fields in your document: "Prove field codes instead of their values" and "Field shading: Always".

Limitations and Syntax

  • The "Field codes" field has a character limit of 255 (including spaces), so the specific steps detailed to a higher place are but useful for displaying short pieces of information. To display longer text, you have a couple of options.

    1. Save the field to your document then paste in the longer text:

      Start past inbound the outline of your conditional statement into the "Field" window without entering the long TrueText or FalseText, and so click "OK" to add the field to your document.
      For instance:

      IF "<< Matter.Condition >>" = "Open" "" ""

      If the field code is not already visible in your document (if you are seeing the field's Expression or FalseText instead), right click on the field and select "Toggle Field Codes". With the field lawmaking visible, click into the TrueText or FalseText quotes (where the long piece of text applies) then start typing in the text or paste it from another source.

    2. Apply Clio Custom Fields containing the long text that yous desire to pull in to your document.
      For case:

      IF "<< Matter.Status >>" = "Open up" "<< Matter.CustomField.1 >>" "<< Matter.CustomField.2 >>"

  • Conditional statements do not support special characters or quotation marks in the text that yous use for your TrueText or FalseText.
    For example, the post-obit statement volition not piece of work properly:

IF "<< Matter.CustomField.Pleading >>" = "guilty" "The accused pleads "guilty"." "The accused pleads "not guilty"."

To display text that contains quotation marks or special characters, you will have to add that data to Clio Custom Fields then employ those merge fields for your TrueText and FalseText.


Tips and Examples of Useful Provisional Statements

Using Clio Checkboxes to Make up one's mind what is Displayed

Using Clio Custom Fields, you can add custom checkboxes to your Contacts and Matters that can be used to determine what is displayed in your generated certificate. To reference a Clio checkbox, utilise the merge field tag in the identify of the beginning Expression. The second Expression will be either "truthful" or "false" - "truthful" if the box is checked, "false" if the box is non checked.

For instance:

IF "<< Thing.CustomField.Checkbox >>" = "true" "This box is checked." "This box is not checked."

Using Clio Picklists to Determine what is Displayed

Using Clio Custom Fields, yous can add custom picklists to your Contacts and Matters that can exist used to determine what is displayed in your generated document. To reference a Clio picklist, employ the merge field tag in the place of the beginning Expression. The second Expression will match the custom pick that should be selected.

For example:

IF "<< Matter.CustomField.Picklist >>" = "option1" "You selected option 1." "You did not select option 1."

To accommodate picklists with more than than 2 options, run into the section below, "Nesting Conditional Statements".

Nesting Conditional Statements (Multiple Conditions)

You can create conditional statements that consider multiple scenarios/weather condition. "Nesting" a condition within some other condition requires a few extra steps and specific syntax to work properly.

For example, to write a provisional statement that looks for all possible responses from a picklist with 4 options, follow these steps.

  1. Click in your document where you want the status to go, and so printing Ctrl+F9 (on a Windows computer) on your keyboard to insert a blank field (2 curly brackets ). If you take a Mac, click the Insert tab > Field, under Field names cull "If", and then click OK. If it says "Fault! Missing examination condition.", highlight that phrase, right-click your mouse and choose Toggle Field Codes.
  2. Within the brackets (the "\* MERGEFORMAT" part of "{ IF \* MERGEFORMAT}" syntax can be removed), type a infinite then begin typing the outline of the conditional statement (note that it is e'er important to have a infinite between all curly brackets and any other characters in your statement).

    The basic outline of this conditional statement should look like this:

  3. Click between the FalseText quotation marks and then press Ctrl+F9 on your keyboard (on a Mac, click the Insert tab > Field, under Field names choose "If", and so click OK. If it says "Mistake! Missing test status.", highlight that phrase, correct-click your mouse and choose Toggle Field Codes) to insert another bare field. This bare field is where y'all will type in some other conditional statement that volition expect for the second option in the list.
  4. Within the brackets of the 2d/nested field, type in the outline of the provisional statement to look for option 2.

    Your nested conditional argument should now look like this:

  5. Repeat steps 3 & iv but his fourth dimension click between the FalseText quotation marks for the second condition before pressing Ctrl+F9 on your keyboard (on a Mac, click the Insert tab > Field, under Field names choose "If", and so click OK. If it says "Error! Missing test status.", highlight that phrase, correct-click your mouse and choose Toggle Field Codes).
  6. Go on adding new conditional statements to the FalseText of each option condition until you have added the last selection. In the FalseText for the last pick, merely enter the text or field that you would like to display if none of the conditions are satisfied.

    The complete statement should look something like this:

    Or, for clearer visibility, the nested conditions tin be colour coded as such:
    { IF "<< Affair.CustomField.Picklist >>" = "option1" "You lot selected option 1." "
    { IF "<< Matter.CustomField.Picklist >>" = "option2" "Yous selected option 2." "
    { IF "<< Matter.CustomField.Picklist >>" = "option3" "You selected selection 3." "You selected selection 4." }" }
    " }

Adding Line Breaks to TrueText and FalseText

If yous need to break upwardly the text that you are using for your TrueText or FalseText, you lot can add line breaks by directly modifying the field codes in your certificate.

If the field lawmaking is not already visible in your certificate (if y'all are seeing the field'south Expression or FalseText instead), correct click on the field and select "Toggle Field Codes".

Y'all will now see the entire field code and be able to edit the text and add line breaks.

Click into the text where you want the line breaks to become then press Shift+Enter to add a soft break.

Troubleshooting Document Generation in MS Discussion

Due to limitations in how MS Word updates fields, you may non see your conditional fields updated appropriately after generating a document through Clio. In well-nigh cases, you will have to open up the newly generated Word document and manually update all fields in guild to see the appropriate values of your conditional statements. To practice so, select all content in your document (using Ctrl+a) so hit F9 on Windows (or fn+F9 on a Mac) on your keyboard to update all fields in your certificate. You will and so have to salve the document and re-upload it to Clio, unless you are editing the certificate using Clio Launcher.

If updating the fields in your generated Word certificate does not fix the problem, so you will demand to determine if the provisional field has any errors. To practise that, use your template to generate a PDF in Clio, then view the PDF. If the field appears correctly on the PDF, then yous can exist assured that your conditional field is working properly. If the field is non appearing correctly in the PDF, then yous will need to go back to your template and look for problems in the field construction and syntax.