Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am working on a mashup with Qlik sense. I wonder if there exists a method that allows me to execute an angular function everytime a Qlik variable changes its value. Or if anyone knows how can I do it. Thanks in advance!
I think the simplest way is to open the variable, for instance using "GetVariableByName" and then listen for its change notifications:
As a first aproach I am using the method selectionState() with onData(). It seems to trigger the function if a variable changes its value. Is it normal? I did not expect this and I do not know if I am missing something.
I change the variable value with a bottom and this changes no value in any field.
thanks again!
I'm not familiar with the details of that API and how it translates into the engine API endpoint, so others might give better answer here. But I suspect that there are conditions where a variable could change where the selection state is not affected. An obvious case would be if the value of the variable is changed explicitly and not through a change in the app data or selection state. I'm therefore not sure the approach you describe here will be complete and capture all cases where the variable changes, but it all depends on your particular use case! I assume listening on the selection state change events should capture most of the cases, so it might certainly turn out to be sufficient in your case if the conditions are right.