Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a button that calls an automation to execute a reload. Prior to clicking the button, the user will make some selections stored as variables. These variables are to be used in the load script. It works as expected reloading from within the app, but not when triggering automation.
In the button, the variables are assigned, then automation called. The automation options for 'Include selections' and 'Run mode: triggered' are selected.
In the automation, the flow is Start (Triggered) > Output (Start) > Inputs (App; Bookmark both as Single input line) > Sleep (5 seconds, may not be needed) > Apply Bookmark (App Id = Inputs > App; Bookmark Id = Inputs > Bookmark; Temporary Bookmark empty but have tried with Yes) > Do Reload (App Id Inputs > App; Wait for reload to complete)
Based on the output I can confirm that the proper app id is being picked up and it's also getting the bookmark which looks something like Temporary\219c98dd-98e0-4b32-9e09-3983deaede84
It runs successfully, however the app is not using the variables which should be stored in the bookmark in the load script so we don't get the expected results after reload.
What am I missing?
Thanks
Hello @AfeefaTk , I cannot provide the actual app, but will see if I can put together a basic example to share.
@AfeefaTk , I've attached the json file for the automation as well as a basic app to show the issue.
In the app, the blue buttons use the native reload option and work as expected. The red buttons call the automation and do successfully reload, however the selected variables are not being passed.
Hi @jackm75
Thanks for sharing the details.
The Do Reload block in automation uses reload API whereas the variable value set via the button in Qlik Sense UI happens in a current user session. This means the reload API cannot access the variable value set in the engine session. More details on Engine session QIX API calls are explained here
Since the variable value updated by the button action is not accessible by the Do Reload block, the corresponding data is not getting reflected in the app once the app is reloaded using the automation.
Could you please let us know the exact use case you are trying achieve using the execute automation in button.
The possible workaround is to update the loadscript using automation via Set LoadScript block before the Do Reload block. But this becomes problematic if the button click is done by multiple users which results in updating loadscript by different users and this might overwrite the loadscript which is not a good practice. This should work for a single user trying to click the button and update loadscript via the automation. But it could be worth checking if that works and let us know your feedback.
Thanks
@AfeefaTk , appreciate the information. While there would only be one user clicking to reload at once, the reload script is fairly complex. Further, the variable being passed is the list of files selected to be imported by the load script. So, I don't think using Set LoadScript would be a viable option.
Help me understand, the button action for 'Execute automation' has a checkbox option stating 'Include selections' which reads 'A bookmark containing all user selections and variables will be created and sent to the automation.' I take this statement as meaning just what it says, selections and variables are stored in a temporary bookmark to be consumed by the automation. Am I not interpreting this correctly?
I did end up using the native reload button option and it works for the users, but I had to give them elevated permissions which I was hoping the automation call would handle without having to do so.
Update: For my situation, I have figured out a work around to be able to use the automation for reload.
After the users select the files to import, I have a second button to confirm the selections. This button sets the variable string and does a partial reload which effectively does nothing more than establish that variable in the app. Then when the Reload button is clicked to call the automation, the proper variable value is used because it's now stored in the app. While this adds an extra button click, it works.