In the previous blog in this series, we learned how to use Slider and Range Slider widgets. In this blog, let us look at various options available under the Navigation Utility function.
* * *
Navigation Utility is a function in scripting exclusive to Analytics Designer that can be used to jump to another Analytic Application, Story or an External URL. You can also jump to Data Analyzer where you can analyze data of LIVE BW queries.
Four Types of Possible Navigation
There are four types of navigation possible from an Analytic Application.
- Analytic Application
- External URL
- Data Analyzer
In addition to the above four, you also have functions where you can generate URL objects of Analytic Application and Story separately.
1. Open Application
The function NavigationUtils.openApplication is used to open an existing Analytic Application. There are three arguments – App ID, URL Parameters and New Tab Flag. The app ID is the only mandatory argument.
You also get the Application Selector option to help you choose the application instead of manually entering the Application ID.
If needed, you can include the second argument – an array of URL parameters. URL parameters can be passed down to Script Variables of the application that you are opening. Such Script Variables can be utilized in onInitialization() event for various purposes like applying filters or changing views.
Script Variables as URL Parameters
Before you can pass the value to a Script Variable, it must be exposed to the URL parameter. So, when you create a Script Variable that needs to get value from URL, check the option Expose variable via a URL parameter.
As a next step, you need to include a URL parameter in the Navigation Utility function by mentioning the Script Variable name and value. A URL parameter can be generated using the function UrlParameter.create() which has two arguments – parameter name and value.
Parameter Name is the name of the Script Variable with prefix “p_” and value can be any string. You don’t need to URL encode the value since that is taken care of by the Analytics Designer.
The last argument in the Navigation Utility function is new tab flag which specifies whether to open the application in a new tab or not.
In the following example, the Navigation Utility function opens an application bypassing the URL parameter value ‘passed_string’ to Script Variable with the name ‘Variable_1’ in a new tab.
There is also a function where you can generate a URL, save it in any local or script variable and then use it in Navigation Utility function. It will be of great help when you want to populate URL using global Script Function.
2. Open Story
Opening a Story is similar to application. NavigationUtils.openStory() is the function to use. It has four arguments – Story ID, Page ID, URL parameters array and new tab flag. You can even choose the Story and the default page using Story selector option which fills the Story ID and page ID argument.
The only change is the URL parameter. URL parameters can be of three types.
- Display Parameter
- Filter Parameter
- Variable Parameter
Display Parameter is used to configure various display properties like display mode (edit, present, embed), show or hide page bar (only applicable to embedded mode), page ID and language.
Filter Parameters is used to create Story Filters. It includes many arguments like model name, dimension name etc. which will be explained in detail in the next blog of the series.
Variable Parameters pass values to variables that are available in the Story. You need to mention the model name, variable name and value as arguments.
3. Open Data Analyzer
Data Analyzer is used to view data of LIVE query without the need of creating a data model. As of Q3.2019 update, only BW LIVE connection is supported. All four optional arguments are connection name, data source name, URL parameters and new tab flag. Full details of the Data Analyzer will be discussed in another blog down the series.
4. Open URL
The last option is simple where you mention the external URL and the new tab flag.
In the next blog, we will learn more about passing filter parameters to a Story.