Skip to main content
All CollectionsFeaturesLogic
Conditional logic and branching
Conditional logic and branching
Updated over a week ago

Conditional logic enables you to create dynamic form paths that guide respondents to relevant questions based on their responses. Respondents never have to skip irrelevant questions — because with display logic, they’ll never even see them.

Conditional logic is available for free to all Formly users.

How to create logic

1. Open form from your Dashboard and go to Logic tab (Display Logic will be selected as a default)

2. Click on Display Logic

3. Select the question and appropriate condition.

In the example below, an extra comment field will only be shown when the respondent answers 9 or 10.

Net Promoter Score (NPS) form

Name: [ ]

Email: [ ]

How likely are you to recommend our product/service to a friend or colleague? [Scale: 0-10]

Criteria to show additional comments box:
Rating must be 9 or 10

Click ⠇next to the logic block to add new condition, remove, or duplicate.

You can also use And/Or logic as shown in the example below:

Criteria to show additional comments box:
Rating must be 9 or 10
AND
Email is not empty

Make sure you use AND/OR correctly, or your form might not work correctly.

You can’t mix and match AND/OR operators within a single IF statement.

However, different IF statement can use different logical operators -AND/OR

Note - It is not possible to set “IF conditions” on these question types - Statement, Payment, Welcome screen, Thank You Screen and Redirect to URL

If you set display logic then the question will be hidden by default and it is only shown when the condition is met.

4. Actions

After adding a conditional logic to your form, you can SHOW a field to the user based on the value of another field. The actions can happen in real time as the user is filling out the form. Also, you can add multiple actions for conditions by clicking on three dots

In the example below, an extra field will only show when the respondent answers 9 or 10.

5. Click Save to set this display logic for your form.

Ordering Logic

When you’re using logic, it’s important that you put them in the right order or your form may not work correctly.

If logic condition(s) are met for multiple conditions then first condition in the order will be shown to Respondents.

Hence it is important to set the most restrictive logics first, followed by the more general ones.

Test your form

Before sending your form to respondents, test different scenarios by selecting different answer options each time.

Did this answer your question?