Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
acgomes
Partner - Contributor III
Partner - Contributor III

Get Variable Value of an App

Hello,

I am using the Get Variable block from the Qlik Cloud Services connector. Currently, I get the following output from this block:

{ "qInfo": { "qId": "56e41a04-d51d-4529-b2a6-27411a63b39d", "qType": "variable" }, "qMetaDef": [], "qName": "vTest", "qNumberPresentation": { "qType": "U", "qnDec": 10, "qUseThou": 0 }, "qDefinition": "=$(vExpression)", "tags": [] }

The definition $(vExpression) is built based on user inputs in an QS app, which returns a number, the value of the variable. I need this number during the reload of another app.

It seems I can not get the value of a variable using the Get Variable block. There is any way to get the variable's value from an QS app in an automation?

Thanks.

Labels (1)
2 Solutions

Accepted Solutions
Vinay_B
Support
Support

Hi @acgomes,

 

The variable in your case needs to be evaluated. Evaluate the qDefinition in an expression and pass that. Let me know if this helps!

If this resolves your query, please click on "Accept as Solution" for confirmation. Thanks!

View solution in original post

acgomes
Partner - Contributor III
Partner - Contributor III
Author

Hello,

I believe it worked. Apparently, we still need to manually add the "$( )" in between the qDefinition in order to the Get Expression Value block to work.

acgomes_1-1658752707497.png

Thanks @Vinay_B , I am tagging both this and your post as solutions.

 

View solution in original post

3 Replies
Vinay_B
Support
Support

Hi @acgomes,

 

The variable in your case needs to be evaluated. Evaluate the qDefinition in an expression and pass that. Let me know if this helps!

If this resolves your query, please click on "Accept as Solution" for confirmation. Thanks!
acgomes
Partner - Contributor III
Partner - Contributor III
Author

Hello @Vinay_B 

Thanks for the help, when you write of evaluate the expression, how and where am I supposed to do this, on the automation? I did try to use the Get Expression Value block, but there was no output.

Let me provide some detail, the content of the qDefinition I need to evaluate is something like this:

=Max({<SELECTED_OPTION_NAME={'$(vOptionSelected)'}>} ID_SELECTED_OPTION)

In the first App, I have a variable input configured as a list box. The user selects an option based in the name "SELECTED_OPTION_NAME", which is stored in the variable vOptionSelected. This expression is then used to retrieve the ID of the option stored "ID_SELECTED_OPTION". Each option has only one ID, so as far as I know, does not matter whether I use Max, Sum or any other agg function.

"SELECTED_OPTION_NAME" is a proper field, but in the list box I do not show all values of this field, only the ones that can be selected based in a flag which comes with the data. Something like this:

=Concat( {<FLAG_SELECTABLE_OPTION={'1'}>} SELECTED_OPTION_NAME, '|')

I hope this provide some context and help to understand what I am doing.

Thanks!

acgomes
Partner - Contributor III
Partner - Contributor III
Author

Hello,

I believe it worked. Apparently, we still need to manually add the "$( )" in between the qDefinition in order to the Get Expression Value block to work.

acgomes_1-1658752707497.png

Thanks @Vinay_B , I am tagging both this and your post as solutions.