cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LionelM
Advocate I
Advocate I

Send an email to one or multiple / Assign a task to one or multiple based on a form question that allows multiple answers

Hello all !

I am newbie to Forms / PowerAutomate and I want to "pump up" a form + flow that I created, to be able to send an email to one or multiple / Assign a task to one or multiple based on a form question that allows multiple answers.

My setup is the following :

- The form gathers the answers

- In the form there's a question about "What department is your request about".

Answer can be multiple as a request can be towards more than one department ( 1 to n )

- After creating the Item in a Sharepoint List, I want to Send an Email and Create a Task in Planner.

Sending the email to one "default" person or creating the Task in planner is easy (Thanks to previous forum Q&A 😀)

 

What I am looking for is to send the email to / assign the planner Task to certain people, depending on the answers provided to the "What department is your request about" answer(s).

 

  • I think I need to do a mapping table to have a matching list between department and recipients

Dept A - user1 email

Dept B - user2 email

Dept C - user3 email

... and so on

 

  • Then I think I need create a temp string which will concatenate the emails

If "form_dept_question_value" contains "Dept A" then "Append to" temp string "user1 email"

If "form_dept_question_value" contains "Dept B" then "Append to" temp string "user2 email"

If "form_dept_question_value" contains "Dept C" then "Append to" temp string "user3 email"

 

Next step will be to use the "temp string" content and use it when creating the email and the Planner Task.

This seems the easiest step (assuming I will find easily the temp string system ID 🤣 )

 

I would need support / advice on how to do this in the most easy way

I am a indeed bit clueless on which steps / features / commands I need to use  ... Support & advices would be greatly appreciated !

LionelM_0-1632324838621.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LionelM
Advocate I
Advocate I

Hello all and to @Hardesh15,

So I made more investigations and I found a way out of this :

- Initialize a string variable at the top of the flow (as you cannot initialize it within the "Apply to each"

- In the "Apply to each", create a parallel flow and use several "Condition" to test if the Answer to the Question contains a text element specific for each of the departments

If Yes : I append to the String variable the email address, and a semicolon at the end

If No : I just do nothing

- Then I can use the content of the String in the Email, or the Create Task, or even in other things (Create post in Teams)

 

Et voila 🙂 .... My flow has grown a bit, and works quite well 🙂

 

LionelM_0-1632342709061.png

 

 

View solution in original post

3 REPLIES 3
Hardesh15
Super User
Super User

@LionelM Please use Switch action and based on department send email and create task. 

Hardesh15_0-1632325465572.png

Please 'Thumbs Up' the posts that helped you and 'Mark as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

LionelM
Advocate I
Advocate I

@Hardesh15 thanks for the tip ! I didn't know about this so I gave it a try.
Good thing : I learned something 😀

Less good thing : Switch apparently only has "Equals" as test ... and I would need more to find something that behaves as "Contains" ...
I'll look into more and will keep digging. Thanks for the reply and the direction to investigate

LionelM
Advocate I
Advocate I

Hello all and to @Hardesh15,

So I made more investigations and I found a way out of this :

- Initialize a string variable at the top of the flow (as you cannot initialize it within the "Apply to each"

- In the "Apply to each", create a parallel flow and use several "Condition" to test if the Answer to the Question contains a text element specific for each of the departments

If Yes : I append to the String variable the email address, and a semicolon at the end

If No : I just do nothing

- Then I can use the content of the String in the Email, or the Create Task, or even in other things (Create post in Teams)

 

Et voila 🙂 .... My flow has grown a bit, and works quite well 🙂

 

LionelM_0-1632342709061.png

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,559)