You can pass the Dashboard parameter value to the value of Web API URL parameter/POST Parameters/Headers. Please follow these steps:
First of all, create the Dashboard parameter by following the steps mentioned in this section.
Choose a Web API data connection in the connection panel to create a web data source and enter the required URL with the required parameter name as shown in the following screenshot.
Now, type the @
symbol near the parameter in the query string and you can see the list of dashboard parameters from the data sources that are added to your dashboard. From that list, choose the required parameter.
If the data source (which has the dashboard parameter) is not present in your current dashboard or you are creating a data source from the data source listing page, use the following syntax to use the dashboard parameter in your web API wherever you want.
Syntax: @{{:DataSourceName.ParameterName}}
After configuring the dashboard parameter and completing the dashboard designing, you can publish the dashboard into the server.
When you view the dashboard on the server, you can modify the value of the dashboard parameter if required. To modify the value, click on the below-highlighted icon, you can view the dashboard parameter pop-up window. Through this window, you can modify the value of a parameter.
When you embed a dashboard into your application and would like to change the parameters’ values based on the user like below screen shot, you can pass the dashboard parameter values as mentioned in this section. You can also find the Syntax for passing the parameter values as follows,
Syntax: embedQuerString += "&embed_user_email=xxx@domain.com" + "&embed_datasource_filter=" + "[{&&ParameterName=Value&ParameterName=Value}]";
Also, find the sample code screenshot as follows
A dashboard will render based on the passed parameter values as shown in the following screenshot.
Here, the &&
indicates the Dashboard parameter and &
indicates the URL parameter. So based on the parameter value passed through the query string, the web API connection will be changed.