Skip to main content
All CollectionsDesigners, controls, fields and editorsDisplay, validation and actions
Using the Set Variables Step to Change the Value of the Status Field
Using the Set Variables Step to Change the Value of the Status Field

Set Variables step is used to dynamically change a field’s value based on user actions or specific conditions.

Updated over 2 months ago

In form actions, the Set Variables step is used to dynamically change a field’s value based on user actions or specific conditions, allowing for automated data processing with ease.


Example: Changing the Status Field Value by Toggling a Confirmation Icon

Scenario: In a list form, when a user checks the confirmation icon next to a record, the status field value should automatically change to “finish.” When the user unchecks the icon, the status field should return to “open.” This bidirectional field change can be automated with action buttons in the form.


Steps:

Step 1: Create the “Change to Finish” Action

  1. Open the form’s settings and go to the action settings.

  2. Click “+New Action” and name it “Change to Finish.”

  3. Click “+Add a step”, from the action step type, select “Set variables.”

Step 2: Configure the Set variables step

  1. Execution Condition: Define the trigger condition. When the condition is met, the system will execute this step.

    • If the condition is not met, select “Continue to the next step if the condition is not met” to ensure the flow proceeds to other steps.

    • Learn more about the Execution Condition of actions.

  2. Single Value: The variable accepts only one value. For example, when the status field is set to “finish,” it can only hold this one value.

    Multiple Values: Allows the field to hold multiple values, such as in multi-selection scenarios.

    • In this example, the status field is configured as a single value field.

  3. Variable Selection: Open the “Variable” expression editor and select the field you want to modify (e.g., “Status” field).

  4. Value: Enter “finish” in the expression editor of the“ Value” field to indicate the new status value.

    After setting the condition, the action will be triggered when the confirmation icon is checked.

Step 3: Bind the Action

In the form design, open the settings window for the confirmation icon.

  1. Open the action bar and set the "Execute type" to "Action."

  2. In the action dropdown, select the "Change to Finish" action you just created.

  3. Now, when the confirmation icon is checked, the status field will change to "finish."

Step 4: Create the "Change to Open" Action

To complete the flow, we also need to set the status field back to "open" when the confirmation icon is unchecked. This allows the status field to automatically return to its initial state when the confirmation is canceled.

  1. Create a new action named "Change to Open."

  2. In the action steps, choose the "Set Variable" step, set the variable to the "Status" field, and set the new value to "open."

  3. Open the settings window for the unchecking confirmation icon and bind the "Change to Open" action to it.

    In this way, by using form action buttons and the Set Variable step type, the status field will automatically change to "finish" or "open" when the confirmation icon is checked or unchecked, automating the flow control.

Did this answer your question?