Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
random_user_3869
Partner - Creator III
Partner - Creator III

automation - create a loop and send a report to each person contain in list values block

Hello qlik team,

 

I face an issue with automation.

I created the following block

lessassy_3869_0-1645985355574.png

 

At the end there is this

lessassy_3869_1-1645985382656.png

 

In the list value block there are 7 values. Each of them contains a mail address.

I put this list of values as output for the variable mail block.

And i try to send a report to the 7 mail values.

The issue is that it only send a mail to the first value.

So i don't know what can i do to fix this issue.

Thank you in advance for the help.

 

Labels (2)
1 Solution

Accepted Solutions
LauraLangenaken
Support
Support

Hi @random_user_3869 ,

How it works is that you've configured it to loop through each user individually and send them a separate email with their individual data. So there are 7 users in your list, as shown in your first screenshot, but they are being processed one after the other.

QAA will grab the first user of your list and go through all the blocks in the loop for that user (Create a report for User 1, Apply the Selection for User 1, Send an Email to User 1,...). As I understand, the first user gets their email without issues. The final block that is executed for User 1, however, is the 'Exit loop' block. This block means you want to stop processing immediately, which is why your automation never makes it to the next 6 users.

LauraLangenaken_0-1646056555653.png

The 'Exit loop' block does not serve any purpose here as far as I can tell, so disabling or removing it will ensure the other 6 users also receive an email that is tailored for them.

If instead you wanted to send the same email to all 7 users at once, you'd have to change the layout of your automation completely, cause that requires a very different set-up.

The following help pages could also be useful: Loop Block and Exit Loop Block.

View solution in original post

6 Replies
LauraLangenaken
Support
Support

Hi @random_user_3869 ,

Why are you using the 'Exit Loop' block in this context? It's hard to tell without the full automation, but the 'Exit Loop' block is usually only executed together with a  condition block to stop processing when a certain condition is met.

If that's not helpful, could you export the JSON of your blend so we can have a look? 

random_user_3869
Partner - Creator III
Partner - Creator III
Author

Hello,

 

Thank for your help.

for the loop block i just use the example as shown in qlik tutorial here (https://www.youtube.com/watch?v=tXyuT_1S23o)

 

You'll find attachend my json file.

Thank you a lot for your help

LauraLangenaken
Support
Support

Hi @random_user_3869 ,

Thanks for sharing the JSON and the reference to the video. You are right that in the video there was an 'Exit Loop' block at the end of the loop, which I believe was disabled, cause it doesn't serve a purpose there.

The 'Exit Loop' block basically means you want to exit your loop as soon as that block is hit and you want to stop processing any other items in the loop. So in this case it will be right after the first report was generated and the first email was sent.

If you disable the 'Exit loop' block (or remove it altogether), normally the automation will just continue to process the next user on your list. 

Could you give that a try and let me know how you get on?

random_user_3869
Partner - Creator III
Partner - Creator III
Author

Hello,

 

Thank you for your feedback.

Well when the all blocks are executed i go to output section and i notice that the report is send to the firs value in the list value field  block.

In the first block i get all 7 values (each values represent an email address)

lessassy_3869_0-1646047783279.png

 

And the next block (create report) only has the first mail (6 are missing)

lessassy_3869_1-1646047969118.png

 

In the end i want this flow to send a report based on the email address which are linked to the data to 7 people. I used the list field values for starting point but i have something missing.

Thank you

 

LauraLangenaken
Support
Support

Hi @random_user_3869 ,

How it works is that you've configured it to loop through each user individually and send them a separate email with their individual data. So there are 7 users in your list, as shown in your first screenshot, but they are being processed one after the other.

QAA will grab the first user of your list and go through all the blocks in the loop for that user (Create a report for User 1, Apply the Selection for User 1, Send an Email to User 1,...). As I understand, the first user gets their email without issues. The final block that is executed for User 1, however, is the 'Exit loop' block. This block means you want to stop processing immediately, which is why your automation never makes it to the next 6 users.

LauraLangenaken_0-1646056555653.png

The 'Exit loop' block does not serve any purpose here as far as I can tell, so disabling or removing it will ensure the other 6 users also receive an email that is tailored for them.

If instead you wanted to send the same email to all 7 users at once, you'd have to change the layout of your automation completely, cause that requires a very different set-up.

The following help pages could also be useful: Loop Block and Exit Loop Block.

random_user_3869
Partner - Creator III
Partner - Creator III
Author

Thank you for your help it worked !