Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
master_t
Partner - Creator II
Partner - Creator II

StoreTempSelectionState / RestoreTempSelectionState APIs not working

Hello everyone

I'm trying to use these two Qlik Sense APIs:

https://help.qlik.com/en-US/sense-developer/February2022/Subsystems/EngineJSONAPI/Content/service-do...

https://help.qlik.com/en-US/sense-developer/February2022/Subsystems/EngineJSONAPI/Content/service-do...

to temporarily store the current selection state of an app, then do some selections and finally restore the selection state as it was before.

However, while the "store" method seems to work:

master_t_0-1650033926136.png

the "restore" method always fails for me:

master_t_1-1650033964948.png

(it returns a "false" result every time, and the selections are not restored)

Am I doing something wrong here, or is the API broken?

I've tried both with the EngineAPI explorer and with the .NET SDK, but the result is the same. Any ideas?

Labels (1)
  • API

2 Replies
Aiham_Azmeh
Employee
Employee

Hi @master_t ,

In the docs, there's a mention about qTTLOfTempState:
`The temporary selection state will be stored for 30min by default if TTL parameter is not present or positive.StoreTempSelectionState method is only supported in SaaS Editions of Qlik Sense.`

https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FStoreTempSelectionState

Looks like this method is only available in Qlik Cloud, `help.qlik.com` doesn't mention this - I will file an issue on it.

 

master_t
Partner - Creator II
Partner - Creator II
Author

That is unfortunate.

Is there an alternative I can use? Before I was doing this by creating a temp bookmark and then restoring it, but I noticed that in some cases when you restore the bookmark the selections are different from what they were when you created it, so it's not reliable.

Another approach I found is to save the original BackCount() value and later subtract it from the current BackCount() to obtain the number of times I should call Back() to get back to the original selections. This works but the problem is that BackCount() stops increasing at 100, so after that there is no way to know how many times you should call Back() to get back to the original selections.

Any other ideas?