Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wangxusq
Contributor III
Contributor III

Mashup get variable

Hi all,

I want to get variable value in mashup.But still failed.

2.jpg

alert : always object object.

1.jpg

I refer to the help :

https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/APIs/Content/CapabilityAPIs/Var...

3.jpg

Anything wrong?

My variable vChange =1,so I want to get 1.

Thanks.

2 Replies
hacr
Creator
Creator

If you look at the documentation you refer to, you notice it is returninger a promise, and not a string.

"Returns a promise of a variable model."


Searched a bit for you and found this one... maybe it'll help you:


Qlik Sense: app.variable.getContent() doesn't return the current variable value


Or this one


https://help.qlik.com/en-US/sense-developer/3.0/Subsystems/APIs/Content/MashupAPI/Methods/getContent...

eduardo_facchio
Partner - Contributor
Partner - Contributor

A little later but if anyone need, just change alert to console.log  or run this for understand :

app.variable.getContent('vChange',function ( reply ){

    alert(reply); // returns [ Object Object ]

    alert(reply.qContent.qString) // returns your variable

    console.log(reply) // returns object in console (F12)

)};