Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
igoralcantara

Automation to receive selections from App and pass it to a report

Good day Qlik community,

I have an unusual requirement. I want my users to be able to click on a button on an app and call an automation sending their selections to the automation and applying the selections to the report. The first part is easy and it is working. I can pass and receive the selections in the automation.

The part that I cannot get it right is the one to pass the selection to the report. For some strange limitation, if I apply a bookmark to my automation, the report totally ignores it. I have to explicitly pass each field selection to the report using the Add Selections to report.

It does work if I create one of these blocks for each field but would require for me to know fields the user will select, which I don't. What I want is to loop through each field and apply the selection for that field.

I am using the block "List Current Selections" to loop these fields. This seems to work. Inside that loop, I am trying to use the block Add Selectiction to Report". That one does not work. It forces me to pick a field by the index (0, 1, 2) instead of do what any loop does and get the index for the corresponding loop iteration.

Ideas?

These are some screenshots that might help:

igoralcantara_1-1711725061434.png

igoralcantara_2-1711725085340.png

 

igoralcantara_3-1711725107227.png

 

Check out my latest posts at datavoyagers.net
Labels (1)
6 Replies
igoralcantara
Author

I think I have it almost figure it out. I understand now that "List Current Selections" is not a loop, so I added a loop after to loop through these items. 

However, this only works if the number of fields I have selected in my app is exactly 3. If I select more, anything after the 3rd field is ignored, if it is less than 2, it fails because the 3rd item is null.

igoralcantara_0-1711737020617.png

 

Any idea why the List Current Selections does not get the currect number of fields from the bookmark?

Check out my latest posts at datavoyagers.net
igoralcantara
Author

One additional thing. Because some fields are text and some are numeric, I had to edit the expressions for "Add Selection to Report" manually:

igoralcantara_0-1711740208257.png

 

Check out my latest posts at datavoyagers.net
AndyPandyLinden
Partner - Contributor II
Partner - Contributor II

Same problem here. The ApplyBookmark shoud make all selections....

 

Skage
Partner - Contributor III
Partner - Contributor III

Hi, I'm also having problems with this.

I can verify, via a get-measure-value block, that the temporary bookmark is applied so the app should have a state that match what I see in the app. But the generated report disregard the current state.

It does not matter if I apply the bookmark before or after creating the report or adding the sheet.

Why does the get-measure show the correct value, even included in the body of the sent email, but the attached pdf contains the unselected state?

Looping over "List Current Selections" seems excessive, and way too complex for such a bread&butter usecase, when a bookmark is already applied or am I not understanding what a "report" is and when/how it is created?
Perhaps an 'Add Selections From Bookmark to Report'-block is needed?

TIA

/lars

Skage
Partner - Contributor III
Partner - Contributor III

I'm one step closer but still the final pdf is not representing the current state of the app.

I really hope that I'm now imagining the situation correctly. There are three sessions towards the same app and the challenge is to align selections in all of them. It's the user-session, the automation-session and the report-session. Aligning the first two was easy, but I'm about to give up on this all together...

 

I can loop over current selections - find each field - find each value for each field and output the exact details on what to select into an output block. "Add Selection To Report" for the found field and a value.

BUT the pdf only contain data from the last performed "Add Selection To Report".

 

I can get a bit closer if I hard code how many values to select but that will not work since a user can make any number of selections in any number of fields. Also since there is an isnum-check for each value this must be performed value by value anyway.

 

Any input is appreciated!

JoshR
Contributor II
Contributor II

I'm not sure I would call this a great solution, but it's working for me, so I thought I'd share.

I've created multiple string variables (10 in my automation) to hold the values in the list of dimensions.

When looping through the list, I check the position of the loop and add the value to the corresponding variable (e.g. variable1, variable2).

I then add all variables to an add value element within the Add Selection To Report block. This works even if only one of the variables is populated.