Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
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)
2 Solutions

Accepted Solutions
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

View solution in original post

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.

 

View solution in original post

15 Replies
AfeefaTk
Support
Support

Hi @marcusva 

If I understand correctly you are not able to get the variable value that is being selected from the app as the output of the Get Expression block in the automation once the button is clicked?

Is that correct?

In order to look into the configuration of the app and automation, could you please share them both?

Thanks

AfeefaTk
Support
Support

Hi @marcusva 

Are you sure that you are using the correct expression in the definition parameter while creating the variables in the UI and also mapping the correct variable name in the Get Expression Value block?

I have run a few tests from my end and it works as expected.

Thanks

marcusva
Contributor III
Contributor III
Author

Hi @AfeefaTk , thanks for your reply!

That's right, the current variable selection or setting is not going to the automation through the apply bookmark block. It seems that it only keeps the variable standard value.

For example, following the steps provided in the video, the standard values for my variables shoud be the field itselt:

vTitle = Title (vComentario = Comentario in my case)

Since there is more than one value for Title, the standard value for the variable is shown as '-' (or null).

marcusva_0-1685122475049.png
Front end before setting values for the variables

In this case, even if I set new values for the variables using the Input visuals, and they are shown in the front end as these updated values and then click the "Update" button, the new setting is not reflected to the automation blocks. Then I get an error, because the automation tries to read a null() value.

marcusva_1-1685122553182.png
Front end after setting new values for the variables

marcusva_2-1685122679232.png
Result from the Get Expression Value block. Note that there's no output, since the value is null

 

However, if I reload the app before clicking update, then the standard values for the variables are set according to the input visuals, for instance:

vComentario = 'New Comment'

Then, if i click the Update button, the automation runs as it was supposed to and there's an output in the Get Expression Value block:

marcusva_3-1685123103528.png

I think the problem is in the Run Automation visual or the Apply Bookmark block, I'm almost sure I'm doing exactly what the tutorials show, but maybe I'm missing something...

Please find attached the app and the automation I'm using. Also, the excel spreadsheet from which I read the data and write back to has the following format:

marcusva_4-1685123339938.png

 

Any help is appreciated, thank you very much!

 

AfeefaTk
Support
Support

Hi @marcusva 

I think the variable expression (vComentarios) defined in the UI is invalid.

Please take a look at the screenshot for reference.

Please correct the error in the expression and see if that solves the issue.

vComentarios.png

Thanks

marcusva
Contributor III
Contributor III
Author

HI @AfeefaTk ,

I think I got it wrong when setting the variable to its standard value before sharing the app.

However, I believe that wasn't the problem. After setting it back to "Comentarios" and running the automation, I got the same error as before. Also, it wasn't working for the other two variables aswell.

marcusva_2-1685358660352.png

marcusva_1-1685358623289.png

marcusva_0-1685358542427.png
variable vComentarios with no output after setting a new value in the UI and hitting the update button.

 

d_abbatelli
Partner - Contributor II
Partner - Contributor II

Hi,

Just wanting to mention that I had the same issue as @marcusva , and that similar issues are also mentioned here.

In my case, i simply reloaded the app visualization (hitting the refresh button on the browser) and after that the Variable Inputs seems to have started communicating with the Automation as expected.

marcusva
Contributor III
Contributor III
Author

Hi, @d_abbatelli 

Thanks for sharing. I've just tried doing the same here, but unfortunatelly I'm still having the same problem...

 

marcusva
Contributor III
Contributor III
Author

Hi all,

Did anyone else have the same problem or any updates? I just can't figure what may be wrong...

AfeefaTk
Support
Support

Hi @marcusva  @d_abbatelli 

If you define an expression in the variable created in the UI, then on the automation side it will just run the expression so user input will be ignored.

If you want to have a user-inputted variable then best to give the variable with no definition/formula.

Could you please try removing the expression from the definition field in the variable and see if that takes the value that is being provided in the input box?

We are also working on updating the demo video to clarify how the variables should be configured on the app side to pass the user-inputted values to the automation.

Thanks!