Vizlib (33) Actions are featured across a number of Vizlib extensions listed here. They provide a number of ways to create and link shortcuts across your apps, improving your user experience.
TABLE OF CONTENTS
- Example
- Working with Actions
- API Integration
- Selection in Field
- Select Excluded
- Select Possible
- Select Alternative
- Forward
- Back
- Lock Field
- Lock All
- Lock All Selected
- Unlock Field
- Unlock All
- Unlock All Selected
- Unlock and Clear All
- Clear All
- Clear Field
- Activate Next Sheet
- Activate Sheet
- Activate Previous Sheet
- Apply Bookmark
- Create Bookmark
- Open URL
- Set Variable
- Reload App
- Open Stories
- Export Object... (Vizlib Button Only)
- Export Data
- Export to PDF
- Sleep
- Prompt
- Open Qlik App
Example
Figure 1 shows an example of Vizlib Actions being used with Vizlib Button. The action used here is Open URL, which integrates with the Button Item YouTube, adding a link to open the Vizlib YouTube channel when the button is pressed.
Figure 1: Vizlib Button Actions Example
Working with Actions
- When you start working with actions, there are a few things to remember.
- You add and edit actions in the property panel.
- You can add more than one action within a sheet.
- Actions are executed in the order they're listed in the property panel (top to bottom).
- Actions can also have specific properties related to the extension, we've listed them here.
Vizlib Table - Inputs/values for actions are now evaluated at row level (this means the same result applies to all rows), see version 3.6.0 for more detail
Vizlib Sheet Menu - Actions can be set before OR after navigating to the next sheet.
Vizlib KPI Designer - Field names for Global Action settings should not use spaces or square brackets [] e.g. [Total Sales] . The actions Selection in Field, Select Possible, Select Alternative will not run if these characters are used.
API Integration
API Integration allows you to complete GET/POST/PUT instructions for REST API endpoints. Documentation can be found here.
Selection in Field
This action enables users to select single or multiple values within a field. There are two inputs required, the field name, and the values.
Field names for all types should be specified as a string result. Expressions can be used but the result is only a string (Figure 2). A string should not be wrapped in quotes, and an expression should not be used for a single string.
Note: The following characters must not be used.
- Equals sign =
- Quotes " " ' '
- Square brackets []
Figure 2: Selection in Field
Expressions can be used, if the resulting strings are dynamic, e.g. variables or expressions that change the output of the result.
Further selection examples are listed here:
- Selecting a single value - A single value can be specified as a string, which can be delivered as a hard coded string, or a resultant string derived from a variable.
- Selecting multiple values - To select multiple values, Qlik sense search strings are supported here. A common format example for selecting multiple values would be: (London|Berlin|Barcelona).
- Important note: multiple values with spaces need to have the following formatting: '("United Kingdom"|"South Korea")'
- Dynamically selecting multiple values:If we want to dynamically select cities that are in Europe, we can do the following: ‘(‘ & Concat(distinct {<Continent={‘Europe’}>} [City], ‘|’) & ‘)’.
The example shown in Figure 3 implements Selection in Field as a Global Action (activated by clicking anywhere in the object), using Vizlib KPI Designer to make selections in Vizlib Table. The ID Field with Field value 7 is defined, so when the KPI object is clicked, the selected row for ID 7 is selected and displayed in the table.
Figure 3: Example
Select Excluded
This action selects all field that have been excluded from the current selection (selected values are shaded dark grey). This may deselect selections applied to other fields. The example in Figure 4 shows 6 values from the ID column selected. When the action is triggered the other 1994 values which had not been selected are displayed.
Figure 4: Example
Select Possible
This action selects all values in the desired field, that are able to be selected within the current selection. The values that are white will be selected.
Note: Field names should not use spaces or square brackets [] e.g. [Total Sales].
Select Alternative
This action selects all values in the desired field, that are alternatively available from the current selection. The values that are light grey will be selected. This won’t affect deselect selections applied to other fields.
Note: Field names should not use spaces or square brackets [] e.g. [Total Sales].
Forward
This actions simulates the effect of clicking the forward button in the selection panel.
Back
This actions simulates the effect of clicking the back button in the selection panel.
Lock Field
Locking a field will lock the existing selections and block future selections until the field is cleared. In Figure 5, you can see that when some ID field values are selected, the values are shown as locked when the selection completes.
Figure 5: Example
Lock All
This action will lock all fields. No selections can be made when fields are locked. No more accidental selections when in this mode.
Lock All Selected
This locks all selected fields, allowing you to drill down with the same set of selections. In the example in Figure 6, several values are selected from the fields Country, Date and ID, which are shown as locked when the action completes.
Figure 6: Example
Unlock Field
This action unlocks a locked field within a selection. In Figure 7, the field ID is specified in the Global Action for the KPI object, and some ID and Country fields are selected. When the action is triggered, the selected ID fields are unlocked.
Figure 7: Example
Unlock All
This action will unlock all fields. Selections can be made again when fields are unlocked.
Unlock All Selected
Unlocks all fields that currently have selections applied. The example in Figure 8 uses Vizlib KPI Designer objects to add actions that lock and unlock selected fields. When several different fields are selected from the Country, Date and ID columns they are locked when the lower KPI object is clicked, and unlocked when the upper KPI object is clicked.
Figure 8: Example
Unlock and Clear All
Unlocks any locked fields in the application, and also clears the selection made before the fields were locked. Figure 9 shows a selection of Country and ID field values selected and locked, then unlocked and cleared when the upper KPI object is clicked.
Figure 9: Example
Clear All
Clears all selections on all unlocked fields in the application.
Clear Field
Clears selections of a given field (Figure 10).
Figure 10: Clear Field
The example in Figure 11 shows selections in the Country field clearing when the KPI object containing the action is clicked.
Figure 11: Clear Field Example
Activate Next Sheet
Activates the next ordered sheet (if any).
Activate Sheet
Activates a sheet selected from a dropdown or chosen by the sheet ID (used only for sheets inside your Qlik Sense environment).
Activate Previous Sheet
Activates the previous ordered sheet (if any).
Apply Bookmark
Applies a chosen bookmark.
Create Bookmark
Creates a bookmark based on the current selection and current state.
Open URL
Opens a URL (the link must contain the protocol identified e.g. https://, http://, ftp://, sftp://). This must be used to link to any resources outside your Qlik Sense environment.
Set Variable
This action can be used to set a variable (Figure 12). Please note that the requirements are similar to select in field etc, a simple string should be entered, or an expression that results in a string, the image below demonstrates use of a simple string to specify both the variable name and value.
Figure 12: Set Variable
Figure 13 shows an example where a switch is used to enable to enable the Country column in the table. By setting the action variable to 1 (Active) in the KPI object, the column can also be enabled when the KPI is clicked.
Figure 13: Set Variable Example
Reload App
The Reload App action (Figure 14) allows a user to trigger a reload (or a partial reload). This is only possible if the user has a security rule linked that allows them to use the reload app ability. Qlik Sense does not provide user feedback on reload progress, it is recommended that this is used with a fast reload, ideally QVD based (to ensure that user’s of your Qlik Sense app are not kept waiting).
Figure 14: Reload App
Open Stories
Open Stories directly links to a story in Qlik Sense (Figure 15) by selecting an option from the Pick Stories dropdown.
Figure 15: Open Stories
Export Object... (Vizlib Button Only)
Export objects to Data, PDF or images (with the ability to add a custom file name). This is the easiest way to access export functionality in mashups. Note: This action only works with Master Items.
Export Data
Export Data (Figure 16) offers a unique export option that can be driven entirely by a user (including customization of the file name), when implemented correctly, without the need for developer input. This opens up further opportunities of self-service reporting and data retrieval using Qlik Sense alone - no need to raise a ticket.
Figure 16: Export Data
Export Data is available with the Vizlib Library extensions, and also supports mashups, and dimensions and measure sets can also be defined using dynamic variables. Figure 17 shows an example where dimensions and measures are linked to a button. When the button is pressed, the data is exported from a Vizlib Line Chart to an Excel spreadsheet.
Figure 17: Example
Export to PDF
Export to PDF (Figure 18) exports data from Qlik Sense into a PDF file, in the example a button is pressed to export a line chart visualization to the file.
Figure 18: Export to PDF
Sleep
Sleep (Figure 19) is an action which sets a time delay in the execution of the next action. The time interval is set in milliseconds.
Figure 19: Sleep
Prompt
Prompt (Figure 20) is used to set properties for instructions contained in a popup. You can choose the popup type (Info, Error, Success), and set the popup title and description.
Figure 20: Prompt
The example in Figure 21 shows Prompt being applied to a button - for each information type, the button message and color changes - Info messages are in blue, Success messages are in green and Error messages are in red.
Figure 21: Prompt
Open Qlik App
Open Qlik App (Figure 22) is used to manage properties for opening another Qlik Sense app.
Figure 22: Open Qlik App
You simply select the app from the Open Qlik App dropdown, select the sheet you want to open from Open Sheet, then enable Pass Selections To Target App if you'd like to transfer your current set of selections to when the app opens (Figure 23).
Open Qlik App