cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

SharePoint List - Latest Item in an HTML Email

I am trying to create a flow that will email the latest addition to a list in SharePoint Online.

I can use the built-in flow to send an email but it's formatted terribly and is hard to read. Is it possible to format the email as HTML but still include only the new addition to the list? I have tried using the 'Select' action and then converting it to an HTML table which works fine, however, it includes all items in the list. I only need the newly added item.

 

This is a screenshot of my flow: https://snipboard.io/HswEPJ.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver III
Resolver III

Re: SharePoint List - Latest Item in an HTML Email

@simonexcel  You want to use the Get Item action, not the Get Items action.

View solution in original post

4 REPLIES 4
Highlighted
Resolver III
Resolver III

Re: SharePoint List - Latest Item in an HTML Email

@simonexcel  You want to use the Get Item action, not the Get Items action.

View solution in original post

Highlighted
Regular Visitor

Re: SharePoint List - Latest Item in an HTML Email

@FoDelement Thanks for your reply. However, if I use Get Item, I have to specify and ID which I don't know because it's a new item. Also, I can no longer create an HTML table using the output from Get Item.

Highlighted
Dual Super User
Dual Super User

Re: SharePoint List - Latest Item in an HTML Email

Hi @simonexcel 

 

Replace select with filter

Capture.PNG

 
When your using getitems specify order
if latest item is first based on your order then use expression
first(body('Get_items')?['value'])?['ID'] 
if latest item is last based on your order then use expression
last(body('Get_items')?['value'])?['ID'] 
 
After filter action, do the same steps with html and send email
 
Another (better) option
When doing getitems query
Order By - to fetch your records based on latest created or modified
there is an property called top count - set it to 1 - so it will return only 1 item based on your order clause
Then use your code with select and html as is
 
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Community Support
Community Support

Re: SharePoint List - Latest Item in an HTML Email

Hi @simonexcel ,

 

Please refer to screenshot below to add the Filter Array in the "Get items" action:

1.png

 

Best regards,

Alice       

 

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

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Users online (8,266)