cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AMH08
Level: Powered On

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

Re: Email every contact in SharePoint List

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

Re: Email every contact in SharePoint List

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

Administrator
Administrator

Re: Email every contact in SharePoint List

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
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
AMH08
Level: Powered On

Re: Email every contact in SharePoint List

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.

claudia
Level: Powered On

Re: Email every contact in SharePoint List

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
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,824)