0

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 1

0

Please following steps:

1.Create the "Person or Group" Column

enter image description here

2.Create MS Flow

  • Add a Trigger "When an item is created" enter image description here

  • Add an Action "Get item" enter image description here

  • Add an Action "Data operations - Select" enter image description here

  • 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. enter image description here

  • Add an Action "Initialize Variable". I name it as 'AttendeesEmail'. Type as 'String' and Value as blank at this stage. enter image description here

  • Add 'Apply to each' where the output of variable 'OriginalArrayAttendees' is entered. enter image description here

  • Add an Action "Data operations - Compose" and in expression enter "concat(item()?['Attendees'],';')" enter image description here

  • Add an Action "Data operations - Compose" enter image description here

  • Add an Action "Set Variable" enter image description here

  • 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. enter image description here

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.)

enter image description here

4.Add "Initialize Variable". I named it as 'OriginalAttendees'. Type as 'Array' and Value will be the Output from previous 'Select' action.

enter image description here

5.Add a Control "Condition". The condition is "Attendees Email" equal "null"

enter image description here

6.If yes.

  • Add an Action "List group member" and select your group name.
  • Then, add an Action "Send an email (V2)"

enter image description here

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) "

enter image description here

enter image description here

4
  • If we add both Users and SharePoint groups it's got failing... Feb 3, 2021 at 15:09
  • Hi, Pradeep Kolli. I have updated my answer. Hope this can help you. Have a nice day! 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 Feb 8, 2021 at 16:24
  • Hi EchoDu, Thank you help... Feb 8, 2021 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.