Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
mostal75
New Contributor III

Extension Variable set

Hello

I've created an extension and I need to create or update custom variable value depending some conditions.

I put a script to create variable and works fine. But when variable already created I need to update it. With this script:

var qApp = qlik.currApp(this);
qApp.variable.setStringValue('AA','test');

variable is updated when put in text object for example....but not in variable editor (nor when I refresh app) !!!!

Do you have any idea please ?

 

Regards

Labels (1)
1 Reply
iharsh220
New Contributor II

Re: Extension Variable set

Hi,

it will not done by using capability API

you have to use Enigne API 

1. use getVariableId() or getVariableName()

"params": {
        "qId": "your variable id" or "qName":"your variable name"
}

2. use setProperties() and pass this jason

{
"handle": 2,
"method": "SetProperties",
"params": {
"qProp": {
"qInfo": {
"qId": "",
"qType": ""
},
"qMetaDef": {},
"qName": "",
"qComment": "",
"qNumberPresentation": {
"qType": 0,
"qnDec": 0,
"qUseThou": 0,
"qFmt": "",
"qDec": "",
"qThou": ""
},
"qIncludeInBookmark": false,
"qDefinition": " " //here you can set variable value
}
}
}