Comment on page
No-Code Rule Builder
Configure logic without needing to write code
Rule Builder allows you to define custom form logic in a natural language, without having to write any code.
This includes the following:
- Conditionally setting certain field values or flags
- Navigating to steps in form or external webpages
- Conditionally showing or hiding elements
- Custom validation (coming soon)
- Calculations (coming soon)
- Calling APIs (coming soon)
Each rule has multiple branches, which are independent statements within a rule.
Each branch include an action (a change in the form, like setting a field value) and a condition (when the action is triggered).
All branches of rules also share the same trigger, which is when the list of rules are run (ex: on a certain form step being completed or field value changing).
If you configure a rule with an action but no condition, it will just run each time the trigger condition is met (such as a certain form step being completed)
Here's an example: let's say I want to create a rule that automatically sets a text field for the State each time a City dropdown option is selected.
I'll create a rule called "Prefill State" and set the trigger for the rule to be whenever the "City" dropdown field value changes.
In my rule, I'll have a single branch. The condition will be if the City dropdown is set to "San Francisco". For this condition, I'll create an action that sets the State field value to "CA". I can add a more conditions based on any other Cities/States I want to support.
Prefilling State based on which City is selected
Select your Feathery form, and then click on the "Logic" Tab. Click "Create Rule" to create a rule and select the Trigger (when you want the Rule to run).
Creating a rule
After creating a new rule, you will be presented with an empty rule and the ability to add your first action.
To get started, add your first action to the rule by clicking "Add Action".
By default, new actions are always a "Set" action which means setting a field value. You can change this by clicking the 3 dots on the action name which will open a menu with various other actions.
To add another action, click the "Add Action" button beneath the set of actions you want to add to. The actions will run in the order that they are added once triggered.
If you only want to run the set of actions depending on another field's value, you can add a condition using the "Add Condition" button above the set of actions. If no condition is set, the action will run whenever the rule is triggered.
To add an additional condition, you can click the "Add Condition" button again. By default, groups of conditions are part of an "And" clause meaning each condition must be true to trigger the actions. However, you can change this to "Or" by clicking the "And" found between the conditions.
Once you have a condition added to your set of actions, you can add an additional clause which by default is an "Else" statement meaning otherwise, do these actions.
"Else" was added by clicking "Add Clause"
You can add conditions to this additional clause as well.
Branches are useful when you have a conditional action but also want to run another action every time the rule is triggered. To add a branch, you can click the "Add Branch" found at the bottom of the rule builder.
An additional branch was added to the bottom by clicking "Add Branch"
Once you save changes on the rule builder, you can view the generated code by navigating to the "Code Editor" tab.