Skip to main content

Set Variables Step

Assign one or more values in a Yeeflow form action, order dependent calculations, and verify saved field changes.

Use Set variables to assign a value to a field or variable when a form action runs. Choose Single Value for one target or Multiple Values for several independent assignments.


What is the Set Variables step?

This step sets the value available to the current form action or later steps. Depending on the form, you can assign a list field, a temporary variable, or a filter variable.

Note

Set variables is available in list forms, approval forms, dashboards, and public forms. The targets you can choose depend on where the action runs.


When to Use the Set Variables Step?

Use the step to set a default before submission, respond to a user selection, or assign a value only when a condition holds. For example, a Calculate amount button can multiply quantity by unit price and store the result in Amount. Use the resulting amount in a later step to calculate Tax.


How to Use the Set Variables Step?

  1. In the form action, add a Set variables step. If the assignment should only run for some inputs, set an Execution Condition. Check Continue next step when condition is not met if the later steps should run when this assignment is skipped. Execution Condition of actions

  2. Select Single Value for one target. In Variable, use the expression editor to choose the target. In Value, enter a number, text, or a date, or use an expression to calculate the value. Make sure the result matches the target type.

  3. For several independent targets, choose Multiple Values and add each variable and its value.

Set variables action settings showing the execution condition, Single Value and Multiple Values, and the selected Priority variable and value.

Note

Assignments within a Multiple Values step have no defined order. If Tax needs the new Amount, set Amount in one step and calculate Tax in the next.

Run the example with quantity 3 and unit price 20. Check that Amount is 60 and Tax is 6 if the test rate is 10%. If you added a condition, also test an input that fails it and check how the next step behaves.

To keep changes to a list record, use the form's save action or add Submit Form with Submit type set to Save after the assignment. If the action can continue past a skipped assignment, use a condition such as the user's confirmation to control both steps. Reopen the record and verify the stored value. Saving a changed list field · Example of updating a Status field

Did this answer your question?