Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
marcusva
Contributor III
Contributor III

Automation Not Applying Variable Bookmark For WriteBack Solution

Hi all,

I've been trying set up an automation to writeback some variables set by the end user to an external excel file in a sharepoint folder. 

For that, I'm following the basic example from Michael Tarallo on the Qlik youtube channel (https://www.youtube.com/watch?v=hYER2nGKctM&ab_channel=Qlik) , which is based on another  article (https://community.qlik.com/t5/Official-Support-Articles/How-to-build-a-write-back-solution-with-nati...) .

However, I'm having a problem when replicating the current state of variables to the Automation.

I tried replicating exatcly the same steps:

1. Setting the layout, creating the variables, update and reload buttons:

marcusva_2-1684948846190.png
(layout - as you can see, the standard values for the variables are '-', since I'm using the fields as definition)

marcusva_3-1684949004391.png
(Update button settings - Include Selections checked!)

2. Creating the automation using the 'Copy Input Block' blocks and adding the three Get Expression Value blocks.

To check whether it is getting the current variable value from the temporary bookmark, I also added an Output block:

marcusva_4-1684949046787.png

marcusva_5-1684949101989.png
(note that the app and bookmark IDs are the same from the used input block)

 

However, I'm not getting the expected result:

After setting different values to the variables with the Input visuals and clicking the Update button in the Analysis App, the output always gives me the default value of my variable.

marcusva_6-1684949228697.png
(note that in the app front-end, the variables are updated)

It's as if my variables were not being updated (or bookmarked) to the current values when sent to the automation.

In this specific example, it's not generating any output, since my variables by definition are the fields, which gives me '-' as an output, as per my first step.

I also did another test, setting the definition of the variables as fixed strings. In this case, I always get the same strings as output.

Would anyone know if there's any step I'm missing? Or if there is any kind of limitation to a specific type of environnment?

 

PS: I found some other posts about selections issues for generating reports, but I coudn't find something specific for variables and writeback function so far.

Labels (3)
15 Replies
danabb
Contributor II
Contributor II

Hi @AfeefaTk ,

I can confirm that if the variable is defined as an expression (starting with the equal sign, like "=Comentarios") the automations ignores the user value.

If the variable is defined as a 'constant' (without the equal sign, as example using the string 'Default comment') then the user input is passed to the Automation.

The problem is, using a constant, the value does not change with user selection, so the variable input will always show 'Default value' (or whatever the user has input there) even if the selected record already has another comment (making it very easy to overwrite a record with the wrong value).

All in all, this behaviour seems to be different than what is shown in the video.

AfeefaTk
Support
Support

Hi @danabb 

I would suggest you follow a different approach mentioned below to get the user-inputted values passed over automation and also have the selected values auto-populated in the input box.

  1. Ensure Include selections are selected in the Execute automation action in the button.
  2. Clear the definitions from old variables.In the example app, the variables are vDealName and vPrediction.
  3. Create new variables with definitions.For eg vDealName2 and vPrediction2 with the definitions =DEALNAME and =PREDICTION.
  4. Set the input boxes to show new variables that is vDealName2 and vPrediction2
  5. In this example,add two set variable actions before executing the automation. The first one will set the variable vDealName to =vDealName2. The second one will set the variable vPrediction to =vPrediction2
  6. Click on the Copy input block from the Execute automation action in the button and paste this into the automation.
  7. Use the Get expression value blocks to get the vDealName and vPrediction variables in the automation. Use the formulas =vDealName and =vPrediction.

Please find the automation and app configured following the above steps for your reference.

Please let me know if that works.

Thanks

marcusva
Contributor III
Contributor III
Author

Hi, @AfeefaTk 

Thanks, using 2 set of variables works like a charm!

The only step I had to add was to add more "set variable actions" to make sure the new variables returned to the standard value (vDealName2 = DealName).

So for me it worked like this:
(step 6 added)

  1. Ensure Include selections are selected in the Execute automation action in the button.
  2. Clear the definitions from old variables.In the example app, the variables are vDealName and vPrediction.
  3. Create new variables with definitions.For eg vDealName2 and vPrediction2 with the definitions =DEALNAME and =PREDICTION.
  4. Set the input boxes to show new variables that is vDealName2 and vPrediction2
  5. In this example,add two set variable actions before executing the automation. The first one will set the variable vDealName to =vDealName2. The second one will set the variable vPrediction to =vPrediction2
  6. Add two set variable actions after executing the automation to set the new variables back to the standard values. The first one will set the variable vDealName2 to =DealName. The second one will set the variable vPrediction2 to =Prediction.
  7. Click on the Copy input block from the Execute automation action in the button and paste this into the automation.
  8. Use the Get expression value blocks to get the vPlatform and vName variables in the automation. Use the formulas =vDealName and =vPrediction.

 

Thank you very much. I will run some tests, but I think this will be sufficient.

However, would you know if more than one user can run this automation at the same time?

For example: I have a team of salesmen and they are using this tool to check and update information for their customers. They both are using the dashboard at the same time with different customers.

 

AfeefaTk
Support
Support

Hi @marcusva 

Yes, those who have access to the button can click on the button and run automation if it's set to run in triggered mode.

As mentioned in this article (check Limitations section) automation cannot have parallel runs. So if the button is clicked by different users at the same time, it won't get executed at the same time. The new runs will get queued and start running once the previous run is completed.

Hope this answers your question.

Thanks

André
Contributor III
Contributor III

I had the exact same issue. I suggest the demo material for this specific case (loading a value to an input box, then updating and writing back) for this functionality be removed/updated.

Creating a basic write back solution with Qlik Cloud - YouTube

Video ‒ Creating a basic write-back example with Qlik Cloud | Qlik Help

Thanks for the solution/work-around @AfeefaTk!

antonio_velarde
Partner - Contributor II
Partner - Contributor II

I had the same issue and your solution helped me a lot. Thank you very much.