Create Variables
You can create variables and constants in App UI, flow, and page artifacts as well as in dynamic layouts and fragments. Variables and constants are assigned a scope based on where they're created, and this scope determines where they can be used. When deciding where to create a variable or constant, consider where you want to use it.
To create a variable or constant in an artifact:
Now that the variable is defined, you can bind it to a component to display its data. Here's a simple example: Let's say you have an Input Text component on a page to display an employee's name. If the data for this component comes from a string-type name variable, you bind the component to this variable.
To do this, open the page containing the Input Text component in the Page Designer and select the component. In the component's Properties pane, open the Data tab. Hover over the Value field and click to open the Variables picker, then select name under Page to populate the data value:
Description of the illustration var-bind-component.png
The {{$variables.name}}
value is shorthand for saying your component is now bound to the page-level variable name
. The double curly braces around the value {{ }}
indicate that the variable can be updated or read by the component. Double square brackets [[ ]]
mean that the variable's data can only be read.
Once a variable is used in an App UI, you can view its usage information under Usages in the variable's Properties pane. You can see which pages access the variable and click links to readily navigate to those pages.