Selection API

This API is reliable and breaking changes are unlikely.

The Selection API is the external interface to Qlik Sense selection state data and it allows developers to work with selection state data returned from the Qlik Associative Engine without having deeper knowledge of internal constructs.

Version history

Introduced 2.2

Getting started

The method is the entry point to the Selection API. It creates a QSelectionState object that encapsulates the selection state.

var config = {
	host: "",
	prefix: "/",
	port: window.location.port,
	isSecure: true
require(["js/qlik"], function(qlik) {
  //open apps -- inserted here --
  var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);

  var selState = app.selectionState( );
  var listener = function() {
    alert('Back count:' + selState.backCount);
    selState.OnData.unbind( listener );
  selState.OnData.bind( listener );

selectionState method

Examples of use

Learn what you can do with the Global API.

Example based on AngularJS

Main script:
 $scope.selState = app.selectionState( );
AngularJS template:
<button type="button" class="btn btn-default btn-xs" ng-click="selState.clearAll()" aria-label="Clear">
  <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>

<li ng-repeat="sel in selState.selections">{{sel.fieldName}}: {{sel.qSelected}}
  <button type="button" class="btn btn-default btn-xs" ng-click="sel.field.clear()" aria-label="Lock">
    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?