In Cloudera Data Visualization , setting parameters through the URL allows you to
dynamically add selection options without altering the app's saved values. These settings can
also be easily shared by including them in emails, documents, or similar mediums.
important
URL strings must use single quotes (be a valid JSON array), and usual
character limitations on URL addresses apply.
The basic syntax for URL formatting:
http://baseurl /arc/apps/app/id ?config.output ={setting : value }
baseurl
The IP address of the site, such as 27.0.0.1:8000
, or
sf.mycompany.org
.
id
Unique number of the dashboard or the visual.
output
The output of the parameter or the picklist.
setting
The available option is VALUE
.
value
An array of value-label pairs in the format
[["value1","label1"],["value2","label2"],["value3","label3"],
...,]
.
The following steps demonstrate how to use parameters through URLs:
On the Values tab of the Settings modal
window, specify the Title and Output
Parameter .
In this example, test and result are used, respectively.
Optional:
You can specify one or more Value:Label pairs.
In this example,
result1:1 is used.
Click APPLY .
In the dashboard, check the possible options for the parameter.
In the test parameter, click the Down
Arrow icon.
There are two options: (All) and 1 .
Select 1 and hover the pointer over the
Filter icon at the top right of the dashboard.
The Current Parameters are set to result:
result1
and result.alias: 1
.
Save the dashboard.
Switch to View mode.
Copy the URL.
In this example, it is http://127.0.0.1:8000/arc/apps/app/38
.
In another browser window, paste the value saved in the previous step, add the code
specific to setting parameters through URL, and click enter.
In this example, two more pairs: result2:2 , and result3:3 are added. The
new code is in bold font, starting with '?'.
http://127.0.0.1:8000/arc/apps/app/38?config.result={values:[["result2","2"],["result3","3"]]}
In the dashboard, check the possible options for the parameter.
Options 2 and 3 appear in the selection list.
In the test parameter, click
Select .
There are two additional options: 2 and 3 .
Select 2 and hover the pointer over the
Filter icon at the top right of the dashboard.
Current Parameters are set to result:
result2
and result.alias: 2
.