web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Loop on form multiple ...
Power Automate
Answered

Loop on form multiple answers

(1) ShareShare
ReportReport
Posted on by 10

I have a form which accepts multiple answers for a question.I have to send email to different persons based on the response received. 

For example if user selects only finanace i have send email to xyz@abc.com

if user selects both finance and hr then i have to send emails to xyz@abc.com and def@abc.com respectively. 

we can send individual emails for xyz and abc.

 

First i am collecting response using get repose details. When an user selects multiple answers, response is comes as string. So i have used compose to fetch the required output and used Initialise variable with create array and passed compose output to create array.

Then i have used Apply to each with array output and switch inside to send emails to difference peoples based on response received.

When i select both responses, current value is coming as ["Finance","HR"] and it is going to default value in the switch

Here i want to iterate loop for finance and hr so that emails can be sent individually.

 

Can some one please help me what is the issue here ?

Accessform.png

Screenshot from 2020-04-10 17-10-14.png

 
 

 

Categories:
I have the same question (0)
  • efialttes Profile Picture
    14,756 on at

    Hi!

    Which expression did you use inside your Compose? Also, which expression did you assigned to your 'Initialize variable' value?

    Without such info, just guessing, it seems your compose is already creating an array... if so my suggestion is to assign compose Compose output to 'Apply to each' input and see if this way everything works as expected.

    If not... please answer above questions, and if possible, share a screenshot from your 'Get response details' outputs so we can inspect its values

    Hope this helps

  • divyagolla Profile Picture
    10 on at

    Thank you for checking the issue.

    please find the answers to your questions 

     

    expression used in compose : 

    createArray(body('Get_response_details')?['r0eeaede2dc99449f8a489631de6bf539'])
    expression assigned initialize variable  : outputs(Compose)
     
    I tried to assign compose output to Apply each but still the default case is getting executed. 
     
    Screenshot from 2020-04-10 18-23-10.png
    Screenshot from 2020-04-10 18-22-21.pngScreenshot from 2020-04-10 18-21-38.pngScreenshot from 2020-04-10 18-18-08.png
    Above are the output details of the flow
     
     
     

     

  • divyagolla Profile Picture
    10 on at

    Screenshot from 2020-04-10 18-18-08.pngScreenshot from 2020-04-10 18-45-02.png

  • divyagolla Profile Picture
    10 on at

    Also i tried with this approach

     

    i have passed just Access Requests as input and i got output of compose as ["Finance","Operations"] 

    This is displaying as String.

    When i passed output of compose to Apply to each i got below error 

     

    ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Compose')' is of type 'String'. The result must be a valid array

  • efialttes Profile Picture
    14,756 on at

    Hi!

    Found a thread whose scope is similar to yours. It is from 2019, not sure if a more elegant method is currenty available

    https://powerusers.microsoft.com/t5/Building-Flows/Multiple-Choice-data-from-Microsoft-Forms/td-p/415682

    Hope this helps

     

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @divyagolla ,

     

    If one option corresponding to an email address, you could try to refer to the following method.

    Initialize an array variable to record options and email.

    41.PNG42.PNG43.PNG

    Please take a try and feel free to let us know if you have any questions.

     

    Best Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 881

#2
Valantis Profile Picture

Valantis 823

#3
Haque Profile Picture

Haque 485

Last 30 days Overall leaderboard