Rule Editor Enhancements and Use Cases
These are pre-release features available through our pre-release channel. These enhancements are also applicable for Edge Delivery Services Forms.
This article introduces the latest enhancements to the rule editor in Adaptive Forms. These updates are designed to help you define form behavior more easily, without writing custom code, and to create more dynamic, responsive, and personalized form experiences.
The table below lists recent enhancements to the rule editor in Adaptive Forms, along with a brief description and the key advantages of each feature:
- Better user experience with targeted error messaging
- Prevents progression with incomplete data
- Reduces form submission errors
- Consistent download experience across forms
- Reduces need for duplicate logic
- Eliminates requirement to create hidden fields
- Greater control over when and how rules are executed
- Enhances interactivity
- Reduces errors in dynamic sections
- Improves user experience with repeated content
- Useful for marketing or tracking-specific flows
- No need for extra scripting or customization
Let’s now explore each method in detail with specific use cases to help you understand how these features can be used to deliver a personalized experience for users
Validate Method in Function List
Enhanced validation capabilities allowing the validate() method to be used in the function list to validate panels, fields, or entire forms. For example, in a multi-step loan application form, you need to validate different sections before allowing users to proceed to the next step.
Scenario: A financial institution offers a multi-step loan application form where users must complete different sections such as:
- Personal Details
- Employment Details
- Loan Details
- Review & Submit
Before a user moves from one step to the next, the form must validate only the fields within the current section. For example, the user should not be allowed to proceed to “Employment Details” unless all required fields in “Personal Details” are correctly filled.
Implementation using validate() in the Rule Editor
A Next button in each panel triggers a rule using the validate() method. The rule checks if all fields in the current panel are valid. If validation passes, the form navigates to the next panel. If not, error messages are displayed, guiding the user to correct the input.
The screenshot below displays the rule applied to the Next button:
In the above rule, the Next button checks whether the fields in the Personal Details section are valid. If the details are not valid, the focus moves to the Name field in the Personal Details panel.
Download Document of Record
Using the DownloadDor() out-of-the-box (OOTB) function in the Rule Editor, allows user to download the Document of Record , if the form is configured to generate Document of Recored.
Scenario: A government agency provides a digital application form for issuing certificates. After submitting the form, applicants often require a copy of the completed form for their records or to share with another department. To improve the user experience, the agency wants to give applicants the option to download a Document of Record (DoR) immediately after submission or at any stage before final submission.
Implementation using DownloadDor() in the Rule Editor
A Download button is added to form using the Rule Editor, a rule is configured to trigger the DownloadDor() function when the button is clicked.
The screenshot below displays the rule applied to the Download button:
If the form is configured for DoR generation, this function generates and downloads the PDF instantly, without requiring any custom function.
Support for Dynamic Variables in Rules
The enhanced rule editor supports the creation and use of dynamic (temporary) variables. These variables can be set and retrieved throughout the form’s lifecycle using the built-in Set Variable Value and Get Variable Value functions.
These variables:
- Are not submitted with the form data.
- Can hold intermediate or calculated values.
- Can be used in conditional logic and actions.
Scenario: An online shopping form allows users to select a product, enter quantity, and choose a country for shipping. The product price is a fixed value captured through a form field, while the shipping charge varies dynamically depending on the country selected.
To avoid cluttering the form with hidden fields, the business decides to store the shipping cost in a temporary variable and use it for real-time calculations.
Implementation using Set Variable Value and Get Variable Value functions in the Rule Editor
A rule is configured on the Address fragment using the Set Variable Value function to assign a temporary variable named extracharge. The value of this variable changes dynamically based on the selected country. For example:
- If the user selects United States, extracharge is set to 500.
- For any other country, extracharge is set to 100.
Later, when the Total Shipment Cost is calculated, the Get Variable Value function is used to retrieve the value of extracharge. This value is added to the Product Price × Product Quantity to compute the final payable amount on the button click.
The Total Shipment Cost field dynamically updates to reflect both the product cost and shipping charge as the user changes the country or quantity.
This approach enables dynamic, real-time calculations without adding extra fields to the form, keeping the structure clean and user-friendly.
Custom Event Based Rules Support
The enhanced rule editor supports custom event handling using the Dispatch Event and On Trigger Event functions. These functions allow different parts of the form to communicate by emitting and listening to custom events, enabling cleaner, modular logic without tightly coupling actions to specific fields.
Scenario: A login form is built using a reusable login fragment that contains Enter Username and Enter Password fields. When a user provides valid credentials, the form validates the input and initiates the Get OTP process. After the user enters a valid OTP, they are redirected to the appropriate page.
Instead of binding logic directly to the fields, the form uses an event-based approach with Dispatch Event and On Trigger Event to improve modularity and maintainability.
Implementation using Dispatch Event and On Trigger Event
The login fragment is added to the form, containing predefined fields for Username and Password. A rule is configured on the Get OTP button to display the Validation Panel, which includes the input field for entering and validating the OTP.
In the Validation Panel, a rule is configured on the Validate button. API integration is used to validate the OTP entered in the Enter OTP field. If validation is successful, a Dispatch Event named LoggedIn is triggered with the event payload containing the API response.
At the form level, a rule is configured to listen for the LoggedIn event. When this event is triggered, the rule displays the redirect message and takes the user to the dashboard page.
When the user submits the form with correct credentials and a valid OTP, the login is successful, and the user is redirected to their dashboard.
Support for custom events allowing developers to create and trigger custom events that can be used as conditions in rule editor.
Context-Based Rule Execution for Repeatable Panels
Adaptive Forms support context-aware rule execution for repeatable panels. This allows rules to apply specifically to the panel instance where the user interacts, rather than affecting all instances or defaulting to the last one.
Scenario: A product order form lets users add multiple products in separate panels. Each panel includes a Number of Product field and a Total Cost field. When a user updates the quantity for a product, the form should recalculate the total price, but only for that specific panel, not for all others.
Implementation using Context-Aware Rules in the Rule Editor
A rule is configured on the Number of Product field inside the repeatable product panel.
The below screenshot displays the rule for the Number of Product field inside the repeatable product panel:
When the quantity is changed, the rule fetches the unit price of the selected product and calculates the total cost for that panel only.
URL and Browser Parameter-Based Rules in Adaptive Forms
Adaptive Forms support dynamic rule execution using external parameters passed through the form URL or derived from the user’s browser environment. This enables personalized and context-aware form experiences based on where the visitor came from or what device they’re using.
Allowed Parameter Types
ref (only string values)??ref=partner123UTM Medium
UTM Campaign
UTM Term
UTM Content
?utm_source=google&utm_medium=emailPath
hostname=www.example.com, path=/signupBrowser Language
Browser Platform
Browser Agent=Mozilla, Language=en-USScenario: A lead generation form needs to tailor its welcome message depending on the traffic source. When a user lands on the form through a Google ad campaign (using utm_source=google in the URL), the form should show a custom greeting.
Implementation using UTM Parameter
A rule is configured on a text field that displays custom message to Google users and it uses utm_source parameter.
The below screenshot displays the rule configured on text message:
If the utm_source parameter value equals “google”, a custom message as “Hello Google users, welcome to the Campaign Ad!” is shown.
This allows marketers to deliver relevant content to users based on the campaign that brought them to the form without requiring manual field input or custom scripting.
These enhancements significantly expand the capabilities of the Adaptive Forms Rule Editor, providing developers with powerful tools to create more dynamic, interactive, and intelligent forms. Each enhancement addresses specific business needs while maintaining the ease-of-use that makes the Rule Editor accessible to both technical and non-technical users.
Additional resources
- Introduction to Rule Editor for Adaptive Forms based on Core Components
- Operator types and events in rule editor of an Adaptive Form based on Core Components
- Rule Editor User Interface for Adaptive Forms based on Core Components
- Different use cases of Rule Editor for an Adaptive Form Based on Core Components
- Difference in various editions of Rule editor
- Using asynchronous functions in an Adaptive Form
- Invoke Service enhancements in the Visual Rule Editor for forms based on Core Components
- Introduction to Custom Functions for Adaptive Forms based on Core Components
- Create a Custom Function for an Adaptive Form based on Core Components
- Scope object in custom functions
- Examples of developing and using a custom function