Variable Fields
Variable fields are special field types that allow you to perform on-demand calculations without saving the results in the database, however the calculated results can be seen in views.
Unlike "calculated value" (formula) fields, variable values do not get stored in the database upon submission, which makes them particularly useful for storing intermediate calculations that are only relevant during a task operation to simplify complex formulas, or for implementing flexible workflows with no need to resubmit the existing records.
As a basic example of variable usage, we will calculate a person's age in an "Age, years" using a numeric variable field.
Instructions
- Create or edit a new application and navigate to the 'Forms' section.
-
Create a Text field 'Name' and a Date field 'Birthday Date'.
- Create a Numeric field 'Age, years' and set the type as 'variable'. Enter the formula: datediff('year', BirthdayDate, currentdatetime())
The field will now calculate the age of the person based on their birthdate and the current date.
You can use the results of variable calculations in the following areas of Flowfinity Actions:
-
Operation Layout (including Layout conditions) – variables will be recalculated each time the Layout is opened.
-
View Column – variables will be recalculated each time the View is opened or refreshed.
-
REST\SOAP View Query and CSV Integration API – variables will be recalculated each time the View is queried via the API.
-
Widgets in Dashboards – variables will be recalculated each time the widget is refreshed. Note: Variables display in a very similar way to Calculated Columns
-
View Sorting conditions, Color Rules conditions, View Filtering conditions – variables are recalculated each time the View is refreshed. Using variables in this context offers great flexibility, allowing you to create or modify conditions without needing to resubmit the records to recalculate the regular formula fields that conditions may point to.