Sitecore Experience Manager

Use conditional logic for your forms

Abstract

Tailor the behavior of your form depending on the input provided by your visitors.

The Sitecore Forms application lets you apply conditional actions to fields in web forms. You can apply conditions to create dynamic change forms that fine tune fields based on user entries. This can be convenient, for example, when you want to be able to send email messages to different departments according to user answers, when you want to show further questions when a user chooses a specific answer, or when you do not want to show the submit button until the user makes a particular choice.

To add conditions:

  1. In the relevant field, in the Form elements pane, in the Conditions section, click Edit Conditions.

  2. In the Conditions dialog box, add the relevant conditions. For example, if for a survey commentary you want to know the reasons for people rating your product poorly, you can display a multiline field. If visitors rate the product well, you can display the submit button. To do this, click Add condition and enter the IF and THEN fields. 

    Note

    Depending on the element you select, the available options from the drop-down list in the target field can differ. 

    You can add multiple actions for different target fields in a single condition group. If the conditions evaluate to true, all actions will be executed.

    Edit conditions for form elements dialog box

    Note

    The THEN statements can contain the following actions: show, hide, enable, disable, and go to page.

  3. Click Apply and save the form.

  4. The conditions now display in the Form elements pane. Click Edit conditions to change them.

    Click Edit conditions in the Conditions section to manage conditions