Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
marco_puccetti
Partner - Creator
Partner - Creator

Mashup getContent function

Hello, i need to get, from a mashup web application, a variable content.

This variable is computed in this form:

Date(Date(Max([Data Decorrenza]) + 1)  + (0 - Sum([Importo Lordo Rata]))/Money(Round(Sum([Importo Lordo Rata]) / Round(max([Data Decorrenza]) - min([Data Decorrenza])))))

the problem is that using the app.variable.getContent, the result is the above expression and not the date value i expect.

Anybody knows how to get the computed variable content?

Thanks

Marco

16 Replies
marco_puccetti
Partner - Creator
Partner - Creator
Author

$("#buttonId").click(function() {

            app.field("[<Name of the field>]").selectMatch(<Value of the input field>, false);

        });

How have i to use this function if i need the text element value and i don't know the content?

Thanks

Marco

marco_puccetti
Partner - Creator
Partner - Creator
Author

Perhaps the getContent function should function also on complex variable and not only on simple numeric content?

Any ideas?

Thanks

Marco

reddy-s
Master II
Master II

Hi Marco,

Just create a field list and make use of the function to select the value from the input field.

reddy-s
Master II
Master II

Marco Puccetti wrote:

Perhaps the getContent function should function also on complex variable and not only on simple numeric content?

Any ideas?

Thanks

Marco

Haven't tried it ever.Got to check.

marco_puccetti
Partner - Creator
Partner - Creator
Author

I need a function to get a variable content or field content from a button trigger function.

Thanks

Marco

marco_puccetti
Partner - Creator
Partner - Creator
Author

I have noticed that the setContent function works perfectly, while the getContent seems to not enter the callback function.

This is the statement:

app.variable.getContent('$(variable_name)',function ( reply ) {

  var sTemp = JSON.stringify( reply );

  var json_parsed = JSON.parse(sTemp);

  sTemp = json_parsed.qContent.qString;

  $("#OBJ_ID").val(sTemp);

  } ); 

This statement is inserted into a javascript onClick routine.

I expect to get the variable value, isn't it?

Thanks

Marco

marco_puccetti
Partner - Creator
Partner - Creator
Author

It seems that $(variable_name) within the getContent function doesn't work.

So how can i get a variable content using the getContent function for a variable of this type:

SET variable =  Date($(date_1)  + $(date_2));

Thanks

Marco