The Rule Builder in BRYTER enables authors to create logic in various parts of their BRYTER application. You can use the Rule Builder to
- Add conditions to transitions or conditional blocks within modules.
- Filter the records of a data view based on specific criteria.
- Filter entries when reading from a database to retrieve only relevant data.
- Filter a collection.
- Determine whether or not to display a certain input of a Multi-Input node.
The Rule Builder is a versatile tool that enables authors to implement conditional logic and make their applications dynamic and responsive to end user inputs and data.
Add conditional logic to your module
In the Rule Builder, you can specify (1) – (3), add (5), delete (4), and group (6) conditions.
A condition consists of the following elements:
- a variable (1): The node or field that is evaluated in this condition.
- an operator (2): The logical operator determines how the variable will be evaluated against the specified value. The list of available operators depends on the variable chosen. For example, a number variable has operators like Greater than or Less than, whereas a text variable has operators like Contains or Contains not.
- a value (3): The specified value must be met by the variable as specified by the operator. If the value element is left blank, a valid condition is created that checks whether or not the variable is empty (e.g., in case of a conditional input node).
For more information, view the list of available conditions.
Add more than one condition
If you specify more than one condition in the Rule Builder, an ALL / ANY toggle switch (7) is displayed above the first condition.
- When the toggle is set to ANY, fulfilling any one of multiple (same-level) conditions (i.e., condition A or condition B or …) is sufficient to trigger an event (e.g., go to a destination node or display a conditional block).
- When the toggle is set to ALL, all conditions (i.e., condition A and condition B and …) must be fulfilled to trigger the event.
Add complex logic with nested condition groups
Select Add group to implement complex logic with nested conditions. This way, you can build conditions using combinations of and/or-logic, such as The person has a PhD OR both a Masters degree AND an LLM.
- A new group is indicated by an indented box – within its original box – that is tinted in a deeper shade of blue. Conditions are evaluated from the innermost (or darkest blue) box to the outermost (or lightest blue) box.
- The gray branching on the left side of the conditions indicates which conditions are evaluated against each other, specified by the ALL / ANY toggle.
Use collections to build conditions
Related articles
- Learn how to assign answer options to categories using databases in this tutorial.