I'm not an API expert but I would suggest looking at the engine API. Maybe this method will do the trick: http://help.qlik.com/en-US/sense-developer/November2017/Subsystems/EngineAPI/Content/Classes/AppClass/App-class-Evaluate-method.htm
Are you using the sense-navigation extension as a button? Do you get any call to the plugin at all?
The behavior should not differentiate between different plugins, so I used the python FullScriptSupport example plugin to try the functionality of using a button to set a variable.
- I noticed that to get the call to the plugin each time you push the button, you must disable the cache. Either with the DisableCache setting or by sending a header from the plugin to disable the cache (the latter is for the object in question, and the former is ).
- Additionally, it's important that you're not including an equal sign in the beginning of the expression, in that case (for both cache enabled and disabled) you will get only one call to the plugin when you save the expression, and no further calls when pushing the button.
In the button extension I added a first action as below:
The vSSE variable was created in before-hand and the full expression looks like this:
To visualize the variable being updated I added a KPI object on the same sheet with $(vSSE) as the expression.
Let me know how it goes!