Field Conditions

Use field conditions to hide or show specific fields in a task based on information entered in a previous field. In the example below, different instruction type fields are conditionally shown based on each choice selected.

screen readers look here

For more information on how task conditions work, see Condition Options for guidance on constructing conditions and some condition basics.

Examples of use

Field conditions can simplify the structure and format of form and task fields, and add dynamic qualities to the experience:

  • If a manager chooses to reject a vacation request, a field could appear asking the manager to input the reason for the rejection.
  • Some fields could be set as department specific, so once a user selects a department, additional fields appear and all the other irrelevant fields are never shown.
  • If collecting feedback about a webinar, a field could appear to collect feedback if an attendee rates the experience below a 7 out of 10 stars.

How to add a field condition

The following instructions explain how to add field conditions to a task that uses fields, like the Assign Task to a Person or the Email: Send a Form action, but the same process works for Instance Fields

  1. From the Workflow Builder page, click an action to configure it.
  2. Within that action, select a field or add a new field.
  3. From the add a field screen:
    1. Select the Advanced tab.
    2. Select Add a Condition.
screen readers look here
From the add a field screen, select advanced, then select conditions.

When setting a field condition, the field is visible if the condition is true. The field is hidden if the condition is false. For example:

  • If Action A is snoozed, and your condition is “If Action A is snoozed”, the task will execute.
  • If Action B is not snoozed, and your condition is “If Action A is snoozed”, the task will be skipped.

    screen readers look here

Create the conditional statement by mix and matching objects. For example, “If Action A has the Action Status Snoozed”. You first select the object type, like Action, Field, or True or False, then select the value, such as “Action A” or “Output Field B” or “True”. See List of selectable conditions options for more information on each option.

  1. Select the type of object you want to add to the condition, then select the object, such as Action Send email or Text EMEA.
  2. Select an operator, such as is equal or contains.
  3. Select the next type of object you want to add to the condition, then select the object, just like step 1.
  4. Add or remove a condition. Select Add a Condition to add new conditions, or select to remove a condition.
  5. Select
List of selectable condition options

To create a condition, compare two objects. To do this, select the object type, then select the value.

For example, to check if an action is completed, select the type “Action”, then select the action. Set the operator to “is equal”. Then, select the type “Action Status” and select “Completed” status.

screen readers look here
  • Field: Select from a list fields available in this Workflow.
  • Field Choice: Only appears if one of the conditions is a single or multiple choice field. Select from a list of available choices.
  • Text: Enter in a value, such as text or integer, to compare against. This accepts more than just strings.
  • True or False: Select from True or False.
  • Action: Select from a list of actions available in this Workflow.
  • Action Status: Select a status that an action may have, such as “Completed” or “In Progress”

💡Tip: Fields that are conditional on other fields should be ordered after the fields that the conditions are based on.

Use a field reference to conditionally display text in a field

In task instruction fields and the body of emails, you can set text to display conditionally based on the value of a field. This method uses field references and conditions to conditionally display text and fields. For all the examples below, replace field-name with the field name of your choice:

💡Tip: If you have trouble configuring the conditions, you may need to set them in the previous editor. See How to open a step in the previous editor.

IF: Defining a condition for text to appear only if a field value DOES exist:

{{#if field-name}}
This is the text will only display if field-name DOES exist
{{/if}}

IF / ELSE: Defining a condition for text to appear if a field value DOES exist and a second condition for different text to appear if the field DOES NOT exist:

{{#if field-name}}
This is the text will only display if field-name DOES exist
{{else}}
This is the text will only display if field-name DOES NOT exist
{{/if}}

UNLESS: Defining a condition for text to appear only if a field value DOES NOT exist:

{{#unless field-name}}
This is the text will only display if field-name DOES NOT exist
{{/unless}}

For more information on field references, see the field references article

Add a field condition walkthrough

In this example, let’s add one field, then depending on the choice, reveal other fields. Here’s what the end result will look like:

Try selecting a something. You can see how the fields change based on your first choice.

You can replace any of the field names or values with choices that work for you.

  1. First, create a web form. See How to create a web form trigger. You could also follow these steps using a web form sent by an action.
  2. Add and configure the options for three fields:
    1. Field 1: Select your favorite vegetable or fruit. Set the field reference name to selectyourfavorite. Set the field type to Single Choice and add Fruits and Vegetables as choices.
    2. Field 2: Choose your favorite fruit. Set the field type to Multiple Choice and add three options.
    3. Field 3: Choose your favorite vegetable. Set the field type to Multiple Choice and add three options.
  3. With all three fields added, go back to the Choose your favorite fruit and Choose your favorite vegetable fields and add a condition so they appear is someone has selected Fruits or Vegetables respectively.
    1. Select the Choose your favorite fruit field.
    2. Select Advanced at the top of the new window.
    3. Select Add a condition.
    4. For the first parameter, select Field, then select Select your favorite.
    5. For the second parameter, select Field Choice, then select Fruits.
    6. Repeat the same process for the Choose your favorite vegetables field, but set the condition to Vegetables instead.

Get help with a problem or question

If something’s not working as expected, or you’re looking for suggestions, check through the options below.

My conditions are not working as expected

Remember that if the conditional statement evaluates to true, the field is hidden or the task is skipped.

For example, when setting a task condition, the task executes if the condition is true. The task is skipped is the condition is false.

  • If Action A is snoozed, and your condition is “If Action A is snoozed”, the task will execute.
  • If Action B is not snoozed, and your condition is “If Action A is snoozed”, the task will be skipped.

Conditions are evaluated from top to bottom. In some cases, it’s necessary to rearrange the order of conditions when you have two or more conditionals linked with and and or statements. For example, it’s usually best practice to put is empty or is not empty statements last.