Manage page variables

Updated at:
Copy as MD

Page variables provide a data transfer feature. You can use them in configurations for interactive actions, API data, and style settings.

How it works

  • Page variable management: Add, edit, delete, and set default values for page variables.
  • Assigning values: Store data in a specified page variable. In an interactive action configuration, you can store the parameters of a triggering event in a page variable.
  • Retrieving values: Use page variables for specified configuration items or to trigger a filter interaction when the variable changes. You can use page variables for the API parameters of a data source and for component properties.

Manage page variables

Define page variables before assigning or retrieving their values. Each page supports up to 100 page variables.

The following example shows how to use page variables in an interactive action configuration.

  1. Drag a component that supports interactive actions to the canvas. In the configuration pane on the right, select Interaction.
  2. Set the action to Assign to Page Variable and click Manage Page Variables.
  3. In the dialog box that appears, click Add Page Variable.
  4. Enter the page variable information and click Confirm.
ParameterDescription
Page variable nameThe name of the page variable. The name must be globally unique. It can contain Chinese characters, letters, digits, and special symbols. The name can be up to 12 characters long. A Chinese character is counted as one character.
Default valueThe default value of the page variable. Setting a default value is useful for data retrieval. For example, if a variable is used for an API data source parameter and has no default value, the parameter will be empty. This may cause data abnormalities.
DescriptionA description of the page variable's purpose. This helps with the maintenance of large applications or pages.

After you create a page variable, you can also edit or delete it in the Manage Page Variables dialog box.

Assign a value to a page variable

Use the Assign to Page Variable action to assign a value to a page variable. For more information, see Interactive configuration.

Use page variables

  • Use page variables for component properties, such as the Associated Link configuration of the iframe component. For more information, see iframe.
  • Retrieve values for page variables from the request parameters of a device or an API in the data source configuration. For more information, see Devices and APIs.