cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahsanranjha
Frequent Visitor

Get Items from SharePoint list, compose email body with all items and send one email using flow?

Get Items from SharePoint list, compose email body with all items and send one email using flow?

1 ACCEPTED SOLUTION

Accepted Solutions

Once you add the "Create HTML Table" action just click the arrow to "show advanced options", you'll see the map ability there.

View solution in original post

20 REPLIES 20
BigShotRob
Advocate I
Advocate I

I would like to chime in and say I'm trying to do this EXACT thing right as we speak and can't seem to get it to work.

v-xida-msft
Community Support
Community Support

Hi @ahsanranjha,

 

Do you want to include all items which are from SharePoint list into an email body?

I think a HTML table could achieve your needs. I have made a test on my side and please take a try with the following workaround:

  1. Choose a proper trigger, here I use Flow Button trigger.
  2. Add “Get items” action.
  3. Add “Create HTML table” action, From set to output of “Get items” action.
  4. Add “Send an email” action. Body set to output of “Create HTML table” action.

Image reference:6.JPG

The flow works successfully as below:7.JPG

 

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

This works.. but is there a way to choose what fields are coming back? The output that gets put in a HTML is just a mess, so unless there's a way to dictate that, I can't see this as a useable solution, because it makes the data I'm trying to show really hard to look at in a meaningful way 😞

 

 

Crossing my fingers here..

Hi @ahsanranjha,

 

Do you want to choose the fields are coming back by yourself?

You could add a “Select” action to filter all items. Please take a try with the following workaround:

  • Choose a proper trigger, here I use Flow Button trigger.
  • Add “Get items” action.
  • Add a “Select” action, within Map entry, please type the content as below:6.JPG

     

  • Add “Create HTML table” action, From set to output of “Select” action.
  • Add “Send an email” action. Body set to output of “Create HTML table” action.

Image reference:7.JPG

 The flow works successfully as below:8.JPG

 

9.JPG

Hope the above solution could help you.

 

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.

1.png

 

This is what I'm loooking at now, so I do have it a little bit more manageable, if the field types I'm returning are flat text, but fields like date come back in that form, just wondering the best way to get those all looking "clean" -- I thought of adding a calculated column for the really problematic fields, but that's not a good long term solution if I have to do this again, which I'm certain I'll want.

 

What do you suggest to be able to clean up the data returned if delivering through an HTML table?

Thanks you. 

how you map list field values in table column. I tried to find it but can't not implement it.

Once you add the "Create HTML Table" action just click the arrow to "show advanced options", you'll see the map ability there.

View solution in original post

Thanks, that was not available when i created flow, after save and publish then i went to check it again, it displays options to map fields.

How do I check if the Get Items returned no values.   I'm running a flow daily to check for items created that day...if no items were created, it still generates an empty email because I don't have conditional logic in it 

pukut
Frequent Visitor

@jcbarrett 

 

Had the same issue. After 3 days of agony finally solved it: length(body('Get_items')?['value']) is equal to 0

snippet01.pngsnippet02.png

Hope this helps!

Flow_User_2389
Regular Visitor

Hi, I am trying to do the same but trying to return a list of items from a shreapoint list based on a criteria within a column. For example - return all items with YES in the YES/NO column. 

I keep getting separate emails for each item on the list and also the email body is all jumbled up 

 

If someone could help that would be great

 

Thanks

Hi  where does the condition fit in? straight after Select? 

and what happens with the conditions? 

Apologies, just started with sharepoint and flow.

pukut
Frequent Visitor

Hi Shabby,

I used Get Items then the condition, after which you define what will happen in the if yes and in the if no branch.

Thank you, Although it seems to be doing something different that I need to. 

Thank you so much though!! Smiley Very Happy

Think i will open up a diff forum question for what i need


@pukut wrote:

Hi Shabby,

I used Get Items then the condition, after which you define what will happen in the if yes and in the if no branch.



.

I don't have the option in advanced options to display the email in HTML in my sharepoint flow.

 

I also tried to customise the columns I wanted to display the information in an email, which did not work.

 

The email I received as a test run turned out as below:

 

screenshot1.jpg

 

 

my sharepoint workflow below, the first two steps are re-occurrence and get items (which work):

screenshot2.jpg

 

Can anyone assist me in this issue?

getting below error

Bagulhem_0-1594037323289.png

 

Hi there, I struggling to do something similar in my flow.... can you please provide screenshots with the various sections expanded?

Thanks.

Hi

 

I'm trying to achieve the same thing.  Were you able to solve this?

 

Thanks

Yes - Use the HTML Create Table - and select the fields you want to display

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,337)