Logic Settings
Overview
The Logic tab of the Form Designer allows you to create conditions and advanced logic scripts that can change the state or the behavior of the selected form component. You can dynamically change a form component's controls, look, and feel using advanced Logic. A form logic consists of two parts: the Trigger and the Action. The Logic feature allows users to implement a rule engine to control and modify field settings, data values, JSON schema, and custom events based on specific conditions. You can apply this feature to each field separately, and users can add multiple instances of Logic to a field if required.
Triggers
Choose a Trigger Type to determine how the condition is written and activated. Configuring the Trigger depends on the selected Trigger Type. The following Trigger Types are available:
Trigger Type | Description |
---|---|
Simple | To define a trigger, specify a form component and its corresponding value. |
Javascript | You supply the JavaScript logic for a form component or its data. Create complex Logic, including loops and dynamic behavior, using JavaScript syntax. |
JSON Logic | You can use JSON logic to create form components or handle data, but it has limitations. The tool is unsuitable for handling loops or dynamic behaviors, and use this when JavaScript is not allowed. |
Event | You define a component event, which triggers the desired action once emitted by the corresponding component. |
Actions
The logic action is the form component behavior that should happen based on the logic conditions you set (i.e., the Trigger). For example, you can activate a button for users of a specific age. In this case, the age range is the Trigger, and activating the button is the action. There are four types of logical actions:
Action Type | Description |
---|---|
Property | To customize field settings based on specific conditions, you have options such as setting a field as required, changing its Label, or turning it off. The changes are made by configuring the Set State to true or false or by entering a conditional text property that adjusts the Label based on the selected component property. |
Value | Use Javascript to change or populate data values in the conditional field. These variables are available for use in your code: row, data, component, and result. |
Merge Component Schema | You can modify the JSON schema parameters of a component by clicking the Edit JSON button after hovering over the corresponding component. Also, you can change the Multiple parameters in a single action. |
Custom Action | You can define a custom action using JavaScript syntax, similar to how you would define the JavaScript trigger type. It allows you to execute a custom event workflow corresponding to other components such as Hidden Field, Data Source, and Button. |
Add multiple Logic instances or actions to your conditional field for complex workflows.