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

Email every contact in SharePoint List

I don't have every part of this Flow concrete in my mind. However, What I want to do is have two SharePoint lists. The first SharePoint list would simply be a contacts list that has multiple fields. The most relevant field to the Flow though would be an email address field which would contain a single email address. The second SharePoint List would be a sort of announcements list that would be for announcing things to people contained in the first SharePoint List.

 

What I want Flow to do is that when an announcement gets created, that it should compile all the email field values from the first SharePoint list then send an email off to them regarding information about the announcement.

 

To test this process. I have the current process:

 

When an Item is created in announcements list

 

Initialize Variable: array emails

 

Get Items from contact list

 

Apply to each Get Items Value

 

     Append to array variable the email field.

 

Send an email to email variable.

 

-------

 

As of current, this fails because it doesn't see a relevant address. The send email block appears to want the data formated in what I'm assuming is comma separated email. However, the array in plain text appears like:

 

["test@test.com","testing2@testing2.com"]

 

Is there a way to take that array and convert it to just:

 

test@test.com, testing2@testing2.com

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @AMH08,

 

Could you please share a screenshot of your flow's configuration?

Further, could you please share more details about the two SP lists that you mentioned?

 

I have created two SP lists on my side, the data structure as below:

Contacts List:3.JPG

Announcements List:4.JPG

 

 

I think there is something wrong with the variable that you initialized, you should initialize a String variable rather than a Array variable.

 

I have made a test on my side, please take a try with the following workaround:

  • Add a "When an item is created" trigger, specify SIte Address and List Name.
  • Add a Variables->"Initialize variable" action, Name set to EmailArray, Type set to String and Value set to empty.
  • Add a "Get items" action, specify Site Address and List Name set to Contacts List.
  • Add a "Apply to each", input parameter set to output of the "Get items" action.
  • Within "Apply to each" action, add a "Compose" action, Inputs field set to following formula:
concat(item()?['Email_x0020_Address'],';',variables('EmailArray'))

Add a "Set variable" action, Name set to EmailArray, Value set to output of the "Compose" action.

 

  • Under "Apply to each" action, add a "Send an email" action, To field set to EmailArray variable.

Image reference:5.JPG

 

6.JPG

 

The flow works successfully as below:7.JPG

 

 

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
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

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @AMH08,

 

Could you please share a screenshot of your flow's configuration?

Further, could you please share more details about the two SP lists that you mentioned?

 

I have created two SP lists on my side, the data structure as below:

Contacts List:3.JPG

Announcements List:4.JPG

 

 

I think there is something wrong with the variable that you initialized, you should initialize a String variable rather than a Array variable.

 

I have made a test on my side, please take a try with the following workaround:

  • Add a "When an item is created" trigger, specify SIte Address and List Name.
  • Add a Variables->"Initialize variable" action, Name set to EmailArray, Type set to String and Value set to empty.
  • Add a "Get items" action, specify Site Address and List Name set to Contacts List.
  • Add a "Apply to each", input parameter set to output of the "Get items" action.
  • Within "Apply to each" action, add a "Compose" action, Inputs field set to following formula:
concat(item()?['Email_x0020_Address'],';',variables('EmailArray'))

Add a "Set variable" action, Name set to EmailArray, Value set to output of the "Compose" action.

 

  • Under "Apply to each" action, add a "Send an email" action, To field set to EmailArray variable.

Image reference:5.JPG

 

6.JPG

 

The flow works successfully as below:7.JPG

 

 

 

Best regards,

Kris

 

 

 

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

Hello, @AMH08!

Have you had an opportunity to apply @v-xida-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Thank you Kris for the hard work. I was able to apply that to my list with success. I can't really share much details about the list for confidential purposes, sadly but the trigger wasn't the issue but rather the actions. Once again, thank you.

Hi,

 

Please can you explain what does it mean "Email_x0020_Address"?

Does it refers to the column name from the Contacts list?

 

Thank you

Claudia

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (4,511)