Dynamic URLs are extremely useful in scenarios where a user wants to connect to a Wyn Enterprise dashboard embedded inside the application to other modules in the system. The quick access to an external URL to obtain additional details about a particular data series is possible by using the Jump To feature. An external URL can either be static or dynamic based on the user's requirement. Users can easily create a dynamic URL through context variable expressions in the target URL. Such expressions retrieve context information, like user details, parameters, and data values, and then pass this information into a URL or resource when triggered by a user action, like rendering a report.
Consider a scenario where a dashboard displays the aggregated sales revenue by country, and the user wants to navigate dynamically from the dashboard to the business application where Wyn Enterprise is embedded. The user wants to get detailed information, each time he clicks a country in a different section of the application. This can be achieved by using expressions in the target URL so that the user is dynamically directed to a page depending on the selected country.
The following sections describe the structure of dynamic URL, available variable names, value types of context variable expression, and instructions to format the context variable expressions.
The structure for a dynamic URL is as follows:
#{VariableName|Formatter}
Note: When you add context variable expression in the static URL, for example, http://www.myapp.com/somePage.html/?user=Jack. The structure of the URL changes, it will now like this http://www.myapp.com/somePage.html/?user=#{user.Name}. These expressions can be added anywhere in the URL, be it domain name, web page locator, or as a URL parameter value.
The following table lists out all the pre-defined variable names that you can use in a URL to make it dynamic.
A context variable returns the data or values that belong to one of the following value types when evaluated:
Single value: It represents a unique data value such as user name, document name, etc. This value type is returned by the variables including User (except user.roles), Document, UrlParameters with a single parameter value, Parameters (except multi-valued parameters), and Slicer Min and Max Values.
Array value: This value type is returned by variables that give a collection of values such as user roles, multi-valued parameter, slicer fetching values from a label slicer, and filtered values. The values are enclosed in square brackets, such as: ["administrator", "everyone"].
Range value: This value type represents a scale range and is returned by the Range slicers in Wyn Dashboard. It is like an array, having only two values that correspond to the minimum and maximum values, for example, [1000, 2000].
Hierarchical Value: This is a complex value type that represents structured data such as the data in a table or pivot table. It is returned by a context variable such as selection and slicer for multi-dimensional scenarios. The data output for this value type is [Dimension1:Dimension2].
The context variable expressions are flexible to allow a user to format the output of the retrieved values. Use a key expression depending on the type of value returned by a variable expression, as explained in the below table:
Following are some examples for dynamic URLs in Wyn Enterprise:
Get the transactions details in a Wyn report by passing the product name from sales aggregation visualized in a dashboard chart. Set the external URL as /reports/view/?dp={"":[#{selection|"[""]"}] for the chart visualization. For example-
http://wyn.grapecity.com/reports/view/5bb586fe-b8e5-44cc-a4a6-cac972ea98aa?dp={"Parameter1":#{selection|"["ProductName"]"}}
Switch from a dashboard and pass over the date range selected in a slicer to another dashboard. Select the visualization such as chart: /dashboards/view/?dp={"":[#{slicer[""].minValue|"#value"}],"":[#{slicer[""].maxValue|"#value"}]}. For example-
http://wyn.grapecity.com/dashboards/view/f681abb8-680a-47ab-ba15-499112ef3553?dp={"Min":[#{slicer["dateRangeSlicer"].minValue|"#value"}],"Max":[#{slicer["dateRangeSlicer"].maxValue|"#value"}]}
Direct users to a version of the knowledge base website http://wyn.grapecity.com/KB/lng=en that matches their language preference for Wyn Portals. The expression to get this URL is-
http://wyn.grapecity.com/KB/lng=#{user.language}