Could you please help me to send email to People or Group field using MS Flow with Allow multiple selections "Yes" and Allow selection of "People and Groups".
1 Answer
Please following steps:
1.Create the "Person or Group" Column
2.Create MS Flow
Add an Action "Initialize Variable". I named it as 'OriginalArrayAttendees'. Type as 'Array' and Value will be the Output from previous 'Select' action, we get only the Attendees Mail address in the array variable.
Add an Action "Initialize Variable". I name it as 'AttendeesEmail'. Type as 'String' and Value as blank at this stage.
Add 'Apply to each' where the output of variable 'OriginalArrayAttendees' is entered.
Add an Action "Data operations - Compose" and in expression enter "concat(item()?['Attendees'],';')"
Add an Action "Send an email". In the "TO" field it will be the 'AttendeesEmail' variable. Rest of the body you can enter the way you want.
3.Save and Test it.
More information, please refer to:
===================== Updated Answer =====================
Please following steps:
1.Add a Trigger "When an item is created or modified"
2.Add an Action "Get item"
3.Add an Action "Data Operation -- Select"
- In 'Select' Action 'From' (input for select) will be the 'Attendees' Field.
- Map Key 'Attendees' to Value 'Attendees Email' (as only email can be used to send a mail.)
4.Add "Initialize Variable". I named it as 'OriginalAttendees'. Type as 'Array' and Value will be the Output from previous 'Select' action.
5.Add a Control "Condition". The condition is "Attendees Email" equal "null"
6.If yes.
- Add an Action "List group member" and select your group name.
- Then, add an Action "Send an email (V2)"
7.If not.
- Add 'Apply to each' where the output of variable 'OriginalAttendees' is entered.
- Then, add 'Apply to each' where the output of variable '(Get item) Attendees' is entered.
- Next, add "Append to array variable".
Name:OriginalAttendees Value: Attendees Email
- Lastly, Add an Action "Send an email (V2) "
-
If we add both Users and SharePoint groups it's got failing... Commented Feb 3, 2021 at 15:09
-
Hi, Pradeep Kolli. I have updated my answer. Hope this can help you. Have a nice day! Commented Feb 8, 2021 at 8:56
-
Thanks you for your help and response. The only change was get SP group email block. If it's custom field we can't get the SP Group ID. So, mostly we need to use REST Call to get it rather then List Group Members Commented Feb 8, 2021 at 16:24
-