Setting Form Control Values
- 06 Sep 2023
- 3 Minutes to read
- Print
- DarkLight
Setting Form Control Values
- Updated on 06 Sep 2023
- 3 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
Displaying data dynamically on Forms is a crucial aspect of modern web applications, and this functionality is achieved through Active Form Flows. Active Form Flows are processes specifically created to update Form content in real time in response to user actions. These flows are initiated by specific events like typing pauses, value changes, or Form entry/exit actions.
Use Cases
Example Use Cases | Description |
---|---|
Real-Time Calculators | Active Form Flows can instantly calculate and display loan repayment amounts or investment returns in a financial application as users input different values. |
Interactive Surveys and Quizzes | Create dynamic surveys or quizzes where questions change based on previous answers, providing a more tailored and interactive user experience. |
Dynamic Product Configurators | For e-commerce websites, use Active Form Flows to allow customers to customize products in real-time, such as selecting product options and seeing the price adjust accordingly. |
Set Control Value Step
As of version 8.9, the ability to set 'Values' using the Set Control Value step for File Upload controls has been discontinued. However, if the 'Specify inputs' property of File Upload controls is enabled (set to True), you can still set values using the Set Control Value Step.
Example
This example demonstrates the creation of a simple calculator that updates and displays calculation results in real time within a number box. Additionally, it incorporates logic to reset or clear the values within all number boxes.
- In the Flow Designer, add a Show Form step. Create a new Form.
- The Form is designed with five Number Boxes: Value1, Value2, and Sum.
- Add an Event Button from the Actions > Events category; name this "Clear Values" button. Add a Button called "Done".
- Navigate to the Form Properties panel. Under FORM RULES > Active Form Flows, select ADD.
- In the Add Active Form Flows dialog, Name the Rule Flow. Select EDIT RULE FLOW.
- In the Rule Flow Designer, select the Done outcome path of the Start step.
- In the Add After dialog, search for the Add step in the Data > Numbers category. After highlighting the resulting step, click ADD.
- Navigate to the Add step Properties panel.
- Under INPUTS > Value1, select Pick. In the Pick Data for Input: value1 dialog: expand Form Data > [Value1] NumberBox, choose Value, and click DONE.
- Under INPUTS > Value2, select Pick. In the Pick Data for Input: value2 dialog: expand Form Data > [Value2] NumberBox, choose Value, and click DONE.
- Add a Set Control Value step from the Form Rules category in the Toolbox. To set multiple control values with one step, use the Create Data step and change the value of the outputs to Form Control.
- Navigate to the Set Control Value step Properties panel. Under INPUTS > Form Control, select EDIT.
- In the Pick Data For Input: Form Control dialog: expand Form Data, choose SumNumberBox, and click DONE.
- Under INPUTS > Value, select EDIT. In the Pick Data For Input: Value dialog: choose Add_Output and click DONE.
- Connect the outcome path of the Set Control Value step to the End step. Save and close the Rule Flow Designer.
- Select the Triggers in the Form Designer in the Edit Active Form Flows dialog. Select Value 2 Number Box and choose ValueChanged as the trigger.
- Select OK to save and close this dialog.
- Add a second Active Form Flow that will clear the values in the number boxes. In the Add Active Form Flows dialog, Name the Rule Flow.
- Under Advanced > Triggers, set Event Button Click to true. Then, Select EDIT RULE FLOW.
- In the Rule Flow Designer, select the Done outcome path of the Start step. Add a Create Data Step to clear all controls on the Form.
- In the Properties panel of the Create Data step, add the Control Names with their matching data type under Data to Create.
- For each Input, map 0 as the constant value.
- For each Output, select Change Value as the mapping type. Then pick the corresponding Form Control to change the value.
- Save and close this Rule Flow.
- Select OK to save and close the Active Form Flow dialog. Save and close the Form Designer.
- In the Flow Designer, connect the outcome path of the Show Form step to the End Step.
Debug
- Select Debug in the top action panel of the Flow Designer.
- When the Form displays, enter a number in each number box.
- The Sum is calculated dynamically. Select "Clear Values" to reset each Number Box to zero.
Troubleshooting
If any issues are encountered while implementing Active Form Flows, check for the following common problems:
- Ensure that the triggers and actions are correctly set up.
- Verify that the Form Controls are named and mapped correctly in the Active Form Flows.
- Double-check that the Active Form Flow rules match the intended user interactions.
Was this article helpful?