What are Variables?
Variables are key when setting up dynamic applications as you can use variables instead of repeatedly entering set values.
Variables act as placeholders for temporary values used in the calculation of a certain value (functions and/or formulas). For example, in the formula a2 + b2 = c2
, a
and b
are variables representing values that are used for calculating variable c
(also a value).
The values used in the variables a
and b
depends on the purpose. For example, whether:
-
A set value is expected
-
A value is being calculated
-
Information from a previous step is included in the calculation.
Different types of variables used when building applications
When implementing variables in your application, it's important to keep the use case in mind. The variable is either selected based on a set value or needs to be generated or determined (calculated). The following explains the different variable types:
Variable
Input variable
Variables that already contain a set value or automatically calculate a value based on an expression. They are defined in:
-
Actions
-
Action events
-
Pages
-
Properties
-
Templates
-
Global variables
Variables that require input by a user, page/endpoint or previous action. Can be assigned a value when using the parent action as sub-action or when an action is initiated manually from the back office. They are defined in:
-
Actions
-
Pages
-
Webservices
Using variables
The following provides an example of where you can apply variables:
Pages menu example:
Data model example:
Note: When applied as a text variable, for example, var:company_name
is shown as Betty Blocks
on a page canvas and also when you preview a page using the Play button.
