If you are Batman, the 'Rules' tab of the form builder is your utility belt. This new feature in Customer Fields is both flexible and powerful. Rules enable you to create conditional logic for form fields, set up advanced options to streamline customer data and take better control over the user experience. With rules, you can define different conditions to take actions such as:
- Show/hide fields
- Show/hide entire form steps
- Add & remove tags from your customers
- Set the value of a field
- Require fields or make them no longer required
- Redirect the customer to a custom URL
- Enable/disable fields (not letting a customer complete a certain field)
Note: Form rules are only available on the app's "Pro" and "Advanced" plans.
Video: Use 'rules' to create conditional fields
As seen in the video above, consider a merchant who sells both retail and wholesale goods: "Are you a wholesaler?" If the customer selects 'yes', then the form displays a
tax ID field and a
file upload for the reseller's permit.
Rules are comprised of conditions and actions. Define your condition(s) and the action(s) that will trigger if your conditions have been met. You can add multiple rules to any form allowing you to create highly personalized and effective forms for pretty much any purpose you can dream up!
The first step with most rules is to define your condition(s). If you define multiple conditions, you'll want to select whether 'all conditions' or 'any condition' needs to be met before triggering your action.
Conditions vary based on field type
Number fields will contain conditions like "greater than" or "less than" while text fields include conditions such as "must be longer than x characters." There are also special conditions for certain fields like email:
Special conditions, ie: "If customer is logged in..."
Conditions that are not dependent on the value of a field or data column is designated a special column, but you don't want to ignore these very powerful conditions. With conditions such as "Customer is logged in" (or not logged in) you can customize your form and show different fields to users who have not signed up yet versus customers that already have an account with you.
You don't have to define a condition
It's also important to note that if you do not define a condition, the action will automatically take effect. This is useful if you want to always trigger a certain action. For example, if you want every customer who fills out that form to be tagged with a certain tag your rule would look like this:
Important note about actions
By default, the app will automatically apply the opposite of any action you create. For example, if you create an action to 'show' a certain field, then the app will automatically hide that field until the condition is met.
Here is a list of all of the actions currently available in Customer Fields! We've also added a short description of actions that need a bit of explanation.
Show or hide a field. If the condition is not met, the opposite will be done by default.
Require field/make field not required
You can, of course, make a field always required in the field edit mode. But if you don't want a field to be required for certain customers, these actions allow you to customize those requirements.
Show/hide form steps
This action is super handy for simplifying complex forms. For example, you could ask your customer for their gender on Step 1 of your form and then when they continue to the next form step show them the relevant form step that contains fields relevant to that customer's gender:
Add/remove tags from your customers
For example, if "Are you a wholesaler" equals yes, then add tag "Wholesale."
Disabling a field is a way of preventing a user from filling out a field without hiding it. A disabled field will appear subdued and prevent user input.
Set field value
Set the field of a separate or hidden data column. For example, assign customers from certain states or provinces to a region of your choice:
Redirect the customer to a custom URL
You can set the default redirect URL in settings, or direct users to different pages depending on specific conditions. Read more about redirect URLs using this help article
Use variables to create powerful logic
You can use the power of data column variables to make your form rules more dynamic. Read more about how to utilize variables in rules using this help article
Do you have something to add?
We plan to build out more 'actions' in the future so please don't hesitate to reach out if you have something to add!