cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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.

Highlighted
Helper II
Helper II

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.
Highlighted
Community Support
Community Support

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,011)