Help Center/ Huawei Cloud Astro Canvas/ User Guide/ Global Variables/ Setting Variables in a Dataset or Navigation Event Action
Updated on 2025-03-24 GMT+08:00

Setting Variables in a Dataset or Navigation Event Action

Variables can be set in the dataset of a widget or the navigation event action of a widget.

Setting Variables in a Dataset or Navigation Event Action

  1. In the upper part of the large screen editing page, click to create and set page variables.

    For example, add the global variable url and set the variable description to URL of the data details page.

    Figure 1 Adding a global variable

  2. Drag the bar chart widget from the All > Chart area to the blank area of the canvas.
  3. Click above the widget, select static data from the configuration process drop-down list box, add the url parameter, and click the save button.

    Figure 2 Configuration process

  4. Click above the widget and configure the widget interaction event.

    1. In the As Responder area, click Interaction Event and select the Clicking data event.
    2. Click Response Actions and select Set Global Variables.
    3. In the action details area, click the plus sign (+), assign the value of the page variable url to the url field in the widget data source, and click the confirm button.
      Figure 3 Value assignment
    4. Click Response Actions and select Page Navigation to jump to an external page. The external page address references the global variable and is set to ${url}. A new window is displayed to open the page address. Click Confirm.
    5. Click Finish. After the setting, when you click the bar chart, the page of the specific URL set in the dataset is displayed.
      Figure 4 Setting page navigation

  5. After the setting is complete, click in the upper part of the page to save the page.
  6. After the settings are saved, click to check the preview effect.

    Click the corresponding data. The corresponding page is displayed, which meets the expectation.