Variable
Last updated
Last updated
In many scenarios, data is not used directly but is stored in a variable to achieve data reuse. Variables are divided into "global variables" and "page variables" based on their scope. The use of variables involves three steps: "definition," "assignment," and "reference."
Global variables are variables that can be referenced by all pages, typically used to store global configuration information.
Definition
Open "Settings," go to "Global," and then "Add Global Variable." Choose a variable name, select a type, and set a default value (optional) to define a global variable.
Assignment
Assign values through "Set Global Data," which can be used in global settings or on a page.
Reference
Global variables can be referenced by all pages.
Page variables are variables that can be referenced by all components and actions within a page, used to store data related to that page.
Definition
Enter the page, open "Data," and then "Add Page Variable." Choose a variable name, select a type, and set a default value (optional) to define a page variable.
Assignment
Assign values through "Set Page Data."
Reference
Page variables can be referenced by all components and actions within the page.