Select to view content in your preferred language

Survey123 repeats in Power Automate

715
4
12-21-2023 01:32 PM
SeanWalsh
New Contributor

I have seen several articles that discuss handling repeats in Power Automate but not regarding my survey.  I have a survey that has work group list. Based on the work group that is selected an email is sent to a specific group of people (every work group has a different list of email addresses) and an attachment is included.  There is a support group list that's within a repeat and I need an email to go out based on the support group with the same attachment.

  • Work Group 1 is chosen - email and attachment goes to that group
  • Support group 2 is chosen - email and attachment goes to that group
  • Support group 3 is chosen - email and attachment goes to that group
  • every repeat creates a new email with attachment 

I want a parallel branch.  One goes to the work group and want the other for the support group.  

0 Kudos
4 Replies
abureaux
MVP Regular Contributor

I recently answered a question about handling s123 repeats in Power Automate. I am on my phone, so digging that out right now is hard. But it’s in my history. I will try to remember to grab the link when i am restarting servers tomorrow. 

0 Kudos
abureaux
MVP Regular Contributor

https://community.esri.com/t5/arcgis-survey123-questions/nested-repeats-in-microsoft-power-automate/... More-so deals with nested repeats. But, the principal is the same - just easier with a single repeat.

You really just need to be careful when working with repeats in Power Automate. As soon as you click on an item in Power Automate that exists within a S123 repeat, Power Automate tries to be smart, and will automatically create a loop based on that specific repeat for you. After if creates that first loop, just be sure to not click on anything that exists in a separate S123 repeat. If you do, Power Automate will start nesting loops. And if you don't have a plan, those nested loops will give you an undesirable outcome.

For this reason, I like to use ParseJSON so I know exactly what I am working with. I can't remember if I specified what software I use in that last thread, so I will do so here: Microsoft Visual Studio Code (VS Code). You can use other software (such as Notepad++, or even regular notepad), but VS Code is highly recommended.

0 Kudos
SeanWalsh
New Contributor

@abureaux Thanks for the response. I have it setup now to send the repeats but an undesired outcome is now happening.  There are two questions that happen.  A primary group and subgroup are chosen in the beginning of the survey.  Primary groups can have multiple subgroups.  I just had a scenario where four emails went to the same group.  Is it possible if the same work group is chosen in the additional group then only one email would be sent.  

Ex. Primary group - Work Group 1 and subgroup 1 are chosen

additional group - Work Group 1 and subgroup 2 are chosen

additional group - Work Group 1 and subgroup 3 are chosen

additional group - Work Group 1 and subgroup 4 are chosen.  

0 Kudos
abureaux
MVP Regular Contributor

Glad you got the first part working.

 Hmm. This could be tricky depending on how it’s all set up. I could have a better look in the new year. If you could upload your XLSX, that would help.

The super short answer is, it may not be doable. But, seeing the form would help. 

0 Kudos