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

Combine SharePoint List Items to One Email

I am trying to create a Flow that will take all items in a SharePoint list and then create one single email that contains those items. I would like the email to be in a text format, so creating an HTML table is not an option. My current flow works, but sends each list item as an individual email instead of combining them into one email.

 

Any help is appreciated.

8.12.19.PNG

 

 

8.12.19 - 2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
jwhite
Level 8

Re: Combine SharePoint List Items to One Email

Hi @mblotz,

You can achieve this by creating a variable at the start of your flow, running an "Apply to each" on the items in your sharepoint list which combines them by updating your variable and then use that variable in the content of your email as below:

Firstly we set our trigger, get the items from the list we need and initialise (set up) our variable:

CombineListStart.png

Next we have an Apply to each using the values from our "Get items" which will go through each item in our list. We use the compose task to join together the current item we want to add to the list and anything stored in the variable. We then set our variable to the output of the compose function so it is saved as we loop through each item.:

CombineListLoop.png

Then outside of the apply to each loop we use the variable in a message:

CombineListMessage.png

Which then gives us the result we need:

CombineListResult.png

 

Hopefully this helps!

 

View solution in original post

4 REPLIES 4
jwhite
Level 8

Re: Combine SharePoint List Items to One Email

Hi @mblotz,

You can achieve this by creating a variable at the start of your flow, running an "Apply to each" on the items in your sharepoint list which combines them by updating your variable and then use that variable in the content of your email as below:

Firstly we set our trigger, get the items from the list we need and initialise (set up) our variable:

CombineListStart.png

Next we have an Apply to each using the values from our "Get items" which will go through each item in our list. We use the compose task to join together the current item we want to add to the list and anything stored in the variable. We then set our variable to the output of the compose function so it is saved as we loop through each item.:

CombineListLoop.png

Then outside of the apply to each loop we use the variable in a message:

CombineListMessage.png

Which then gives us the result we need:

CombineListResult.png

 

Hopefully this helps!

 

View solution in original post

mblotz
Level: Powered On

Re: Combine SharePoint List Items to One Email

Hi @jwhite ,

Thank you for the great explanation and wonderful screenshots - It worked! I appreciate your time and expertise.

 

Do you have any tips on how I can go about formatting the final email? All of the required content is included, but there are no line breaks. 

 

Thanks Again!

JPVE
Level: Power Up

Re: Combine SharePoint List Items to One Email

If you insert a "<p>" between "ListToEmail" and "Test1" it will create a line break

Wackmack88
Level 8

Re: Combine SharePoint List Items to One Email

@mblotz This works perfect! I have an question. How can i get a line break in the compose / variable?

I have al my titles in one line so it's really hard to read now. 

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 257 members 5,182 guests
Please welcome our newest community members: