Variable API
This API is reliable and breaking changes are unlikely.
qlik.app.variable
The Variable API is the external interface to Qlik Sense variables.
Version history
Each method and property contain information around when it was introduced, updated, deprecated or removed. A list of all relevant API changes per version release can be found in API version history.
Version state | Details |
---|---|
Introduced | 1.0 |
Updated | 2.1 |
Getting started
You must first connect to the Qlik Sense app, and you do this with the qlik.openApp method. You can then use the qlik.app.variable.get method to get an existing variable.
var config = {
host: 'QSE_domain',
prefix: '/',
port: 443,
isSecure: true,
webIntegrationId: 'web-integration-id-here' //only needed for SaaS editions
Examples of use
Learn what you can do with the Variable API.
Create a new variable
Use the qlik.app.variable.create method to create a new variable.
var config = {
host: 'QSE_domain',
prefix: '/',
port: 443,
isSecure: true,
webIntegrationId: 'web-integration-id-here' //only needed for SaaS editions
Create a session variable
You can also create a variable that only exists in the session. To do so, use the qlik.app.variable.createSessionVariable method.
var config = {
host: 'QSE_domain',
prefix: '/',
port: 443,
isSecure: true,
webIntegrationId: 'web-integration-id-here' //only needed for SaaS editions
Get the variable content
Use the qlik.app.variable.getContent method to get the variable content.
var config = {
host: 'QSE_domain',
prefix: '/',
port: 443,
isSecure: true,
webIntegrationId: 'web-integration-id-here' //only needed for SaaS editions
Set a numeric value
Use the qlik.app.variable.setNumValue method to set a numeric variable value.
var config = {
host: 'QSE_domain',
prefix: '/',
port: 443,
isSecure: true,
webIntegrationId: 'web-integration-id-here' //only needed for SaaS editions
Set a string value
Use the qlik.app.variable.setStringValue method to assign a string value.
var config = {
host: 'QSE_domain',
prefix: '/',
port: 443,
isSecure: true,
webIntegrationId: 'web-integration-id-here' //only needed for SaaS editions