Qlik Community

Ask a Question

Integration, Extension & APIs

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

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
oz_moyal
Creator
Creator

Evaluate expression in extension

Hi,

i'm developing an extension

I need to evaluate expression only when a button is pressed

i saw that the Engine API has evalulate method, which is what i need

I just not sure how can I access the Engine API from my extension ?

Any example would be appreciated

thanks!

1 Solution

Accepted Solutions
3 Replies
ErikWetterberg

Hi,

Another option is of course to add the expression to the extensions properties. The result will then be in the layout

Erik Wetterberg.

oz_moyal
Creator
Creator
Author

Yes, i know that

the problem is that this expression is actually initiating a server side extension

and we want to control when it is being called, so we want to do it only when button is pressed (when it is in the properties is always calculated)

At the end i managed to do it like this (in the paint function):

function btn_cilck(){

app.createGenericObject( {

sse_reply: {

     qStringExpression: "={my expression})"

}

}, function ( reply ) {

var str = " sse_reply:" + reply.sse_reply;

//we need to destroy it now, other wise it will refresh it on any future reload (without click)

app.destroySessionObject(reply.qInfo.qId);

alert(str);

});

}

And thanks for the post about how to use Enigma, VERY helpful!