cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kenneth0596
Level: Powered On

Send an email depending on multiple choice question

Hi everyone,

 

I have a multiple choice question (which department should be included? User can select multiple answers) and depending on the response to that question, the flow will send out email to corresponding department lead. For instance, a user select Finance and HR then the email will go to Finance director and HR director. Any help would be greatly appreciated, thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Send an email depending on multiple choice question

Hi @kenneth0596,

 

You can follow these steps to create a Flow a bit complex, but I will explain it as clear as possible:

Step 1: We need to get the value of the choice answer from the MS Forms by using the Get response details action;

Step 2: After we get the response detail, we need to process the response into an array. The choice answer could not convert into an array directly because of it will be String format return, so we need to remove these characters: ", \, [, ] by using the replace() function, after that, use the split() function to convert it into array and initialize a variable named Choice.

Step 3: Initialize a String variable named EmailAddress to store email address according to the Department name (Choice there is) in the next steps.

Annotation 2019-11-19 173451.png

 Step 4: Loop through the Choice array, to find the corresponding email address. Get items from the list of Department, then filter array - if Department is equal to the current item of the Choice array. (On the left side of condition, the Department should be dynamic content, department name or title). After filter, append the corresponding address into the EmailAddress variable.Annotation 2019-11-19 174807.png

 After loop, you can get the variable with EmailAddress of these departments, then it can be used in to field in the send email.Annotation 2019-11-19 175423.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Send an email depending on multiple choice question

Hi @kenneth0596,

 

I assume the data in choice should be the name of the department, what is the connection between the department's email address and the department's name?

If a user selects multiple departments, do you want to send multiple same emails to multiple departments or send one email to multiple departments and put their addresses in the CC?

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

kenneth0596
Level: Powered On

Re: Send an email depending on multiple choice question

Hi Lin Tu,

The data in choice is the name of department. I have another SharePoint which contains all department related information, name, email etc. Essentially I want to use something similar to vlookup where department equals xxx then grab information from department SharePoint.

I want to send one email to multiple departments.
Community Support Team
Community Support Team

Re: Send an email depending on multiple choice question

Hi @kenneth0596,

 

You can follow these steps to create a Flow a bit complex, but I will explain it as clear as possible:

Step 1: We need to get the value of the choice answer from the MS Forms by using the Get response details action;

Step 2: After we get the response detail, we need to process the response into an array. The choice answer could not convert into an array directly because of it will be String format return, so we need to remove these characters: ", \, [, ] by using the replace() function, after that, use the split() function to convert it into array and initialize a variable named Choice.

Step 3: Initialize a String variable named EmailAddress to store email address according to the Department name (Choice there is) in the next steps.

Annotation 2019-11-19 173451.png

 Step 4: Loop through the Choice array, to find the corresponding email address. Get items from the list of Department, then filter array - if Department is equal to the current item of the Choice array. (On the left side of condition, the Department should be dynamic content, department name or title). After filter, append the corresponding address into the EmailAddress variable.Annotation 2019-11-19 174807.png

 After loop, you can get the variable with EmailAddress of these departments, then it can be used in to field in the send email.Annotation 2019-11-19 175423.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,280)