Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mostal75
Contributor III
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
Contributor III
Contributor III

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
}
}
}