Use Variables & Expressions
Last updated
Last updated
Variables are placeholders used to hold and maintain certain values. In some cases, it is possible to not know some of the values that you might want to display or use within the Application. In this case, you can use Variables where the real value can be substituted in later. Expressions can also be configured and are useful for doing certain calculations and returning results which can also be used in the Application.
It is recommended that you read the article listed below to improve your understanding of Variables and Expressions.
To add a Variable to the Application, follow the steps below:
Open the editor for the Application.
2. Open the page the Variable will be stored in. 3. Click on Page Data. 4. Click on the plus symbol to add a new Variable.
5. Type the name of the Variable. 6. Enter the type and whether it is a value or expression. 7. Click on Save.
The Variable should show in the list of Variables.
To use a Variable, follow the steps below:
Highlight the Block you want to bind the Variable to. In this case, it is a textbox for the user’s input.
Click on Block Properties.
Expand Value.
Select the Variable
Click on Save.
When adding a Variable, there is an option to build an expression. The example below shows an expression that multiplies the values of two variables together. To build an expression, follow the steps below:
Change the mode to expression.
Select the expression box.
Select from a range of parameters, Variables, and other functions to build an expression. When a value is selected it will appear in the expression box.
Numbers are identified as integers by default. Convert to other data types using:
a method e.g.ToLong(0)
for the value 0 as a long
2.0
for the value 2 as a double
4. Click on Save.
To delete a Variable, follow the steps below:
Click on Page Data.
Click on Edit to edit the Variable.
Click on Delete.
4. Confirm that you want to delete the Variable.