Adding conditions to a form

With the use of conditions, you can add rules to your forms. This allows you to automate actions within the form when these conditions are met. For example, you can display additional questions, send notifications, or export data. By assigning an alias, you can set conditions that will activate the container when the specific alias meets the given condition. Various aliases can also be related to each other. Follow these steps to apply conditions within the form:

Where Can I Add a Condition?

  1. Go to 'My Forms' and select the form to which you want to apply conditions, or create a new form.
  2. Start a new row. Then, select the container element.
  3. When you select the container element, you can edit this element. To apply conditions, click on the condition icon in the left black bar. See the image below.
    condities_menu_EN
  4. Next, you will be asked to specify one or more conditions within the container. The content of the container will only be shown if the condition evaluates to 'true'.

Note: If an incorrect input is made (e.g., an unknown alias), the border of the input box will turn red. If the software recognizes and can execute the condition, the border of the input box will turn grey.

Alias_fout_EN 

Alias_goed_EN

Setting a Single Condition

The purpose of a condition is to display the content of a container in a form when the condition is met. An alias refers to another value within the form. The condition specifies what this value must satisfy. If the value matches the set condition ('true'), the container with this condition will be activated. Several options are possible:

 condities_soorten_EN

Example 1 (Condition Based on a Value)

For the alias @v5, a number from 1 to 10 can be given. I want to show a container only if the number given for this question is greater than 5. The condition would be: @v5 >=5. The container will now only be shown if the result of v5 is greater than 5.

condities_voorbeeld_EN

Example 2 (Condition Based on Text)

A container can also be shown or hidden based on a specific word entered in a text input element. The condition is set as follows: @v1 = "Incontrol".

condities_tekst_EN

Example 3 (Condition Based on a Calculation)

A condition can also be based on a calculation. In this example, a calculation element checks the result of adding @v10 to @v11. If the multiplication result is greater than or equal to 10, the container will be shown; if it is lower, the container will not be shown. The condition is set as: @v10 + @v11 >= 10.

condities_calculatie_EN

Combining Conditions

It's possible to link multiple aliases and show a container only if multiple conditions are met. You can use 'and' or 'or'. Using 'and' means the container is shown only if multiple aliases meet the condition.

Example: The container is shown only if the checkboxes for @v6 and @v7 are both checked ('true'). The condition would be: @v6 = true and @v7 = true.

condities_checkboxen_EN

Using 'or' means the container is activated as soon as one of the mentioned aliases or conditions is met.

Example: The container is shown if either of the checkboxes is checked, or both are checked. The condition would be: @v8 = true or @v9 = true.

Scherm­afbeelding 2024-06-04 om 16.13.06

Executing Conditions in a Specific Order

Conditions follow a specific order. If no parentheses are used, conditions will first process multiplication (*) and division (/), then addition (+) and subtraction (-), and so on based on the rules below. By using parentheses, you can specify which condition should be evaluated first before following the standard order.

Example: (@alias1 + @alias2) * 2 >= 5.

In this example, @alias1 is added to @alias2 first before being multiplied by 2 due to the parentheses. Finally, it checks if the result of the multiplication is greater than 5 to determine whether to show a container.

Rules

Conditions are evaluated in the following order:

  1. Parentheses (….)
  2. Multiplication or division *, /
  3. Addition or subtraction +, -
  4. Greater or less than >,=>, <, <=
  5. Equal to or not equal to =, !=
  6. 'and'
  7. 'or'

Supporting Elements

The following variables can be used to set a condition. See the examples for their application.

condities_variabelen_EN

Using Checkboxes

The result of checkboxes is used within conditions using 'true' (if the checkbox is checked) and 'false' (if the checkbox is not checked). Containers can be activated if the conditions of multiple checkboxes are met.

condities_meerdere_checkbox_EN

Using Scoped Aliases

Conditions also work with scoped aliases. Read here how a scoped alias can be used.

Using Percentages

If a number is entered in a number field in the form, a condition can be set based on a percentage of the entered number.

Example: For a certain measurement (@number1), the new value may deviate by a maximum of 25% from the number 4. The condition set is @number1 * 25% <= 4.

Technical Capabilities

Want to know more about the technical capabilities of conditions? Check out the article "Setting Conditions in the Form".