Using logic5 Min.14 Min.

Learn about different types of branch conditions for your logic

Tripetto offers several types of branch conditions to add the desired logic and smartness to your forms. In this article we explain the different types to do so.


Branches in form builder

In this article we showed how to add branches to your form. One of the items we addressed over there was branch conditions. Let's take a deeper look into that.

Types of branch conditions

Adding multiple branch conditions.

To determine when a certain branch should be shown to your respondents you have to add the desired branch condition(s) to each branch. To do so, you click the button at the bottom of the branch block. Now you can use several types of branch conditions, which we'll describe in detail below:

  • Basic conditions;
  • Evaluate conditions;
  • Regular expression conditions;
  • Device conditions.

You can use all condition types totally flexible within each branch, so you can also make combinations of different types of conditions and then let the behavior of the branch decide when the branch should be followed.

In that way you can create simple branches with one condition like this example, but you can also make combinations of conditions like in this article.

Basic conditions

In most cases the basic conditions will be sufficient. You use them to validate if the given answer of a certain question matches your wish(es). For example:

  • If the respondent selects the 'Other...' option at the dropdown question 'Question 1', then show this branch (also see this help article);
  • If the respondent gives a rating of '5 stars' at the rating question 'Question 2', then show this branch (also see this help article);
  • If the respondent answers 'Option 1' and/or 'Option 2' at the multiple choice question 'Question 3', then iterate through this branch for each selected option (also see this help article);
  • If the respondent enters the right password for the password question 'Question 4', then show this branch (also see this help article).
Example of a branch with a basic condition.

Evaluate conditions

For more advanced conditions based on the respondent's answers, you can use the evaluate condition. Just like the basic conditions, you use them to validate if the given answer of a certain question matches your wish(es), but then with some more advanced filters. For example:

  • If the respondent does not select 'Option A' at the dropdown question 'Question 5', then show this branch;
  • If the respondent selects a date in the date question 'Question 6' that's between 'January 1, 2020' and 'January 31, 2020', then show this branch;
  • If the respondent gives a rating of '3 stars or higher' at the rating question 'Question 7', then show this branch;
  • If the respondent enters an email address that contains '@gmail.com' at the email address question 'Question 8', then show this branch;
  • If the respondent does not answer 'Statement 1' of the matrix question 'Question 9', then show this branch.
Example of a branch with an evaluate condition, with the condition settings opened.

Regular expression conditions

Regular expression are a bit more complicated, but very powerful to check if an answered value matches a certain desired format. You declare the desired format in a regular expression. For example:

  • If the respondent enters a value that starts with 'hi' at the text question 'Question 9', then show this branch (regular expression used for this: /^hi/);
  • If the respondent enters a value that's exactly 8 uppercase characters (for example a discount code) at the text question 'Question 10', then show this branch (regular expression used for this: /^[A-Z]{8}$/);
  • If the respondent enters a value that's exactly 16 digits (for example a social security number) at the text question 'Question 11', then show this branch (regular expression used for this: /^[0-9]{16}$/).
Example of a branch with a regular expression condition, with the condition settings opened.

Tip

You can use regex101.com to create and test your regular expressions.

Device conditions

With device conditions you can show/hide certain parts of your form to users of a certain device (based on the screen size). For example:

  • If the respondent is using a 'Phone (small screen device)', then show this branch;
  • If the respondent is using a 'Desktop (large screen device)', then show this branch;
  • If the respondent is using a 'Phone (small screen device) or Tablet (medium screen device)', then show this branch.
Example of two branches with different device conditions.

Video tutorials

We have made some video tutorials on how to use branches. It shows where to do this in the form builder and what options you have.

Video tutorial on simple logic
Video tutorial on branch logic
Video tutorial on advanced logic
In this article

    Help us improve