Configuring Parameters¶
You can use parameters in DTV to improve the usability of your widgets and dashboards. DTV supports the following types of parameters:
- Page parameters: Self-defined parameters that you can append to a dashboard URL to display dynamic data. By using page parameters, you can display dynamic widget titles and rich text, or change the values of calculated fields dynamically.
- Widget parameters: Parameters that are passed in through the data source configured in a widget.
- Data parameters: Fields of the dataset configured in a widget.
Page Parameters¶
Creating Page Parameters¶
Before you can start using page parameters, you need to create a global filter for it.
Each global filter corresponds to one page parameter. If you want to create another page parameter, you need to add a new global filter, with the same key as the page parameter.
You can add a page parameter by following these steps:
- From the toolbar of the dashboard page, hover over Filters and click Global Filter.
- On the sidebar, click Add Filter.
- In the Title box, specify a name for the global filter.
- In the Key box, specify the name of your page parameter.
- Leave the Visible on Pages checkbox unchecked.
- Select the Accepting External Parameters checkbox.
- Click Save.
Referencing Page Parameters¶
You can reference page parameters in the following locations:
- Widget Titles: Enter
${parameter_key}
in the Title box - Rich Text Widget: Enter
${parameter_key}
in the text area. Alternatively, you can select the parameter from the Insert Field list. - Calculated Field: Enter
global.<parameter_key>
. You can check the parameter keys by pressing the CTRL key.
For example, if you specify your title as ${place} Station
, and pass the parameter place=Beijing
, then the title will be rendered as Beijing Station
.
For more information about using page parameters in URLs, see Specifying Page Properties through URL.
Widget Parameters¶
You can reference widget parameters by using the syntax @{parameter_key}
in widgets or params.<parameter_key>
in Calculated Fields.
Data Parameters¶
You can reference data parameters by using the syntax #{field_ID}
. If the data is an array, only the first item is returned.