[]
        
(Showing Draft Content)

Dynamic URLs

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.

Dynamic URL Structure

The structure for a dynamic URL is as follows:


#{VariableName|Formatter}

  • #{} is the identifying segment for the dashboard rendering engine that needs to be evaluated to extract data from the dashboard.

  • VariableName is the predefined variable name to define the criteria from where the data value is to be fetched at runtime.

  • Formatter is the styling expression that tells how the retrieved value will appear in the generated URL.

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.

Variable Names

The following table lists out all the pre-defined variable names that you can use in a URL to make it dynamic.

Variable

Description

Syntax

User

Gives the contextual information about the currently logged-in user in the URL. The user attributes that can be accessed using this property are name, email, id, language, roles, securityProvider, showWelcomeOnStartup, tenantId, tenantName, theme, and themeName.

You can access this variable using the following ways:

1. Dot operator-

#{user.attributeName}. For example, user.name.

2. Pair of square brackets-

#{user["attributeName"]}. For example, #{user["name"]}.

Document

Gives the information about the current dashboard document such as its name and id.

You can access this variable using the following ways:

1. Dot operator-

#{document.attributeName}. For example, #{document.name}.

2. Pair of square brackets-

#{document["attributeName"]}. For example, #{document["id"]}.

URLParameter

Retrieves the content from the data store on the server by passing a value directly to the URL. A URLParameter is a name-value pair where the name and value are separated by an equal sign (=) in a URL. These parameters are present at the end of a URL after a question mark (?).

You can access this variable using the following ways:

1. Dot operator-

#{urlParameters["ParameterName"]}. For example, #{urlParameters["Country"]}.

2. Pair of square brackets-

#{urlParameters.ParameterName}. For example, #{urlParameters.Country}.

Parameter

Retrieves the values of the dashboard parameters.

The syntax for this variable is as follows-

#{Parameters["parameterName"]}. For example,

#{Parameters["PostalCode"]}.

Slicer

Makes the slicer states on the dashboard page available in the expression when used for navigation in scenarios like chart, table, or pivot.

The syntax for this variable is as follows-

#{Slicer[slicerScenarioName]}, where 'slicerScenarioName' is the name of the slicer component used on the dashboard page.

Note that the range slicers such as DataRange, DateRange and RelativeDate also have minimum and maximum values which can be accessed using the following expressions-

#{Slicer[slicerScenarioName].minValue} and

#{Slicer[slicerScenarioName].maxValue} respectively.

Filtered Value

Returns the filtered values of a dimension or measure which has been filtered by related slicers, pivot filters, drill-down, and data-bound chart.

The syntax for this variable is as follows-

#{FilteredValue["columnName"] where 'columnName' is the name of the dataset dimension or measure whose data is filtered for a scenario. For example,

#{FilteredValue["Department"]}.

Selection

Retrieves the data values from an aggregation visual selected in the preview such as chart plots, data cells in table, or pivot.

The syntax for this variable is as follows-

#{Selection}.

Value Types of Context Variable Expressions

A context variable returns the data or values that belong to one of the following value types when evaluated:

  1. 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.

  2. 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"].

  3. 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].

  4. 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].

Format Context Variable Expressions

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:

Value Type

Format Keyword

Example

Output

Single Value

#value

#{user.name|#value}

John


#value

#{user.name|"#value"}

"John"


#value

#{user.name|"#value@grapecity.com"}

John@grapecity.com

Array Value

#value

#{user.roles}


#value

#{user.roles|#value}

[Admin, Everyone]


#value

#{user.roles|#value}

[Admin, Everyone]


#value

#{user.roles|"#value"}

["Admin", "Everyone"]


#value

#{user.roles|WYN-#value }

[WYN-Admin, WYN-Everyone]

Range Value

#value

#{Slicer["rangeSlicer"]}

[1000, 2000]


#value

#{Slicer["rangeSlicer"]|#value}

[1000, 2000]


#value

#{Slicer["rangeSlicer"]|"#value"}

["1000", "2000"]

Hierachical Value

["columnName"]

#{Slicer["treeSlicer"]}

[A1:B1, A1:B2, A2:, A3:B4]


["columnName"]

#{Slicer["treeSlicer"]|["DimA"]:["DimB"]}

[A1:B1, A1:B2, A2:, A3:B4]


["columnName"]

#{Slicer["treeSlicer"]|"["DimA"]"~"["DimB"]"}

["A1"~"B1", "A1"~"B2", "A2"~"", "A3"~"B4"]


["columnName"]

#{Slicer["treeSlicer"]|"["DimA"]"~["DimB"]}

[["A1"~B1, "A1"~B2, "A2"~, "A3"~B4]


["columnName"]

#{Slicer["treeSlicer"]|["DimA"]}

[A1, A2, A3]


["columnName"]

#{Slicer["treeSlicer"]|"["DimA"]"}

["A1", "A2", "A3"]

Examples for Dynamic URLs

Following are some examples for dynamic URLs in Wyn Enterprise:

  1. 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"]"}}

  2. 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"}]}

  3. 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}