You can learn more about sending email, using templates, and using expressions with workflow in the Workflow: Sending Email section.

You can use If expressions to conditionally include or exclude portions of a workflow template. You can use If expressions in:

  1. Google Docs templates
  2. Word Doc templates
  3. Email Subject, Body, and PreHeader templates.
  4. Notify Title and Body templates
  5. SMS Body templates
  6. Webhook Body templates

Each If expression begins with <<If: <Yes/No expression>>. Each If expression ends with <<EndIf>>. If the <Yes/No expression> yields the value "Yes" or true, then the template content between <<If>> and <<EndIf>> is included; otherwise, it is excluded.

If Expressions Can Conditionally Display a Field

You can use an If expression to conditionally display a field. For example, you can display the Address if the person is at least 21 years old; otherwise, the Address is omitted.

<<If: [Age] >= 21>>
Address: <<[Address]>>
<<EndIf>>

This could be expressed more concisely as:

<<If: [Age] >= 21>>Address: <<[Address]>><<EndIf>>

If Expressions Can Display Updated Field

You can use an If expression to display a field when its value has changed. For example:

<<If: [_THISROW_BEFORE].[Address] <> [_THISROW_AFTER].[Address]>>
Old Address: <<[[_THISROW_BEFORE].[Address]]>>
New Address: <<[[_THISROW_AFTER].[Address]]>>
<<EndIf>>

If Expressions Can Be Nested

If expressions can be nested to arbitrary depth. For example:

<<If: [Age] >= 21>>
<<If: [Gender] = "Male">>
<<If: ISNOTBLANK([Address])>>
Address: <<[Address]>>
<<EndIf>>
<<EndIf>>
<<EndIf>>

This could be expressed more concisely as:

<<If: AND([Age] >= 21, [Gender] = "Male", ISNOTBLANK([Address]))>>
Address: <<[Address]>>
<<EndIf>>

If Expressions Can Contain Start Expressions

If expressions can contain Start expressions. For example:

<<If: COUNT([Related OrderDetails])>0>>

Order Detail Records

<<Start: [Related OrderDetails]>>

Product: <<[Product]>>
Qty: <<[Qty]>>
Amount: <<[Amount]>>

<<End>>

<<EndIf>>

Start Expressions Can Contain If Expressions

Start expressions can contain If expressions. For example:

Order Detail Records

<<Start: [Related OrderDetails]>>

Product: <<[Product]>>
<<If: [Qty] > 1>>Qty: <<[Qty]>><<EndIf>>
Amount: <<[Amount]>>

<<End>>

If Expressions Can Contain Images

If expressions can contain images. This allows you to include or exclude an image based on the value of the If expression. For example:

<<If: [Count]=1>>
Image: <<[Image]>>
<<Endif>>

If Expressions Can Contain Web Images

If expressions can contain web images. This allows you to include or exclude an image obtained from the web based on the value of the If expression.

For example, when using a Google Doc template, you can conditionally include a web image as follows:

  1. Open the template in Google Docs
  2. From the Insert menu select Image and choose an image. For example, you could select By URL to enter a URL. You might enter:
    http://cdn0.iconfinder.com/data/icons/harmonicons-02/64/check-box-512.png
  3. Click the inserted image and resize it as desired.
  4. Insert an If before the image. For example:

    <<If: [Answer]=true>
  5. Insert an Endif after the image. For example:
    <<Endif>>

This will include a marked checkbox image if the Answer field is true.

You can include an unmarked checkbox image if the Answer field is false as follows:

  1. Repeat the first three steps above, but enter this URL:
    http://chittagongit.com//images/square-icon/square-icon-13.jpg
  2. Insert an If before the image. For example:
    <<If: [Answer]=false>
  3. Insert an Endif after the image. For example:
    <<Endif>>

If Expressions Can be Contained in Table Cells

If expressions can be contained in table cells. This allows you to include or exclude content within the cell. 

This example displays the person's Age if they are an adult and "Minor" otherwise.

This example displays the Count in bold italics if it negative and in normal text otherwise.

Did this answer your question?