Self Service Dashboard URL Parameters Syntax

When you save your dashboard, it is usually saved in its current state using whatever filter you have set. But in some cases, you may want to have several pre-set filters instead of the one saved (for example, you want the same dashboard for different months) or you want to set the filters dynamically when needed (for example when you want to see a detailed dashboard of a particular order id selected from a previous dashboard). It is possible thanks to URL parameters. This document describes the syntax uses for these URL parameters.

A Self-Service Dashboard URL, looks like this:

https://self-service-dashboard.com/app/abcdefghij/show

Parameters can be added by appending an interrogation mark (?) at the end of the URL. Multiple parameters are separated by an ampersand (&).

https://self-service-dashboard.com/app/abcdefghij/show?Parameter1=value1&Parameter2=value2

To set a filter to a specific value, the name or the parameter (e.g.: Parameter1 or Parameter2 in the previous example), must follow a particular syntax:

source_id:column_number[:modifier_id]

source_id:

– If the source is a data source, then it is the name of the data source

– If the source is a filter control, then it is the name of the control preceded by the dollar sign ($)

column_number:

The number of the column starting at 0.

modifier_id:

Optional. One of the following value:

  • year
  • month
  • day
  • hour
  • quarter
  • dayOfWeek
  • upper
  • lower

 Important: all ids are case sensitive.

Example 1:

https://self-service-dashboard.com/app/abcdefghij/show?Sales:3:year=2016

This will set the year of 4th column (remember, the column number starts at 0) of the data source “Sales” to 2016

Example 2:

https://self-service-dashboard.com/app/abcdefghij/show?$RangeFilter:0=2016-01-01&$RangeFilter:1=2016-12-31

This will set the first column of the control named “RangeFilter” to the January, 1st 2016 and the second column to December, 31th 2016. In case of a range filter control, the first column is the lower bound of the range (From) and the second columns is the upper bound of the range (To).

As you may have noticed in the second example, values also need to follow a specific syntax depending on their type.

  • number:          Dot sign as decimal separator. No grouping symbol. The value must be exact (not rounded).
  • date:                 ISO format (2016-09-30)
  • time:                ISO format (05:37:42)
  • datetime:        ISO format (2016-09-30T05:37:42)
  • string:              semi-colons (;) and backslashes (\) must be escaped with a backslash (\). see below.

You can pass multiple values by separating them with a semi-colon (;). If one value contains a semi-colon (;) or a backslash (\), they must be escaped with a backslash (\).

 

Using Filter Values in other URL

Self-Service Dashboard provides a user interface to set the parameters of other URLs such as, for example:

https://data.mycompany.com/Sales?Area=WEST

But sometimes, the URL you want to access may look like this instead:

https://data.mycompany.com/Sales/WEST

To achieve that, simply put the parameter name (using syntax described above) in curly bracket:

https://data.mycompany.com/Sales/{AreaList:0}

It will be automatically replace by the value selected or nothing if nothing is selected.

Warning: If several values are selected, they will be separated by semi colons (;).

 

Using Filter Values in Google Queries

In Google data sources, you use a query (see https://developers.google.com/chart/interactive/docs/querylanguage) to restrain the set of data returned. For example:

   select A, B, C where year(D) = 2016

If you want to replace “2016” by the value of another filter, simply put the parameter name (using the syntax described above) in brackets:

   select A, B, C where year(D) = [YearList:0]

If no year is selected, the where statement will be omitted.

If several years are selected, the where statement will be modified to:

   where (year(D) = 2016 OR year(D) = 2015 OR … )

Warning: this syntax is only available in the “where” clause and you cannot use it in expression such as:

   where E = [Sales:4] * 0.1

instead use the following condition:

   where E / 0.1 = [Sales:4]

Note: you can also the curly bracket syntax similar to the one for external URLs. But, in that case the values will be replaced without any consideration of the query syntax.

For example, let’s consider this query:

   where year(D) = {YearList:0}

if no value is selected it will generate the following query:

   where year(D) =

which will result in a syntax error.