cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TBuente
Level 8

Only get newest Sharepoint item?

Hi,

 

I have made a flow that involves sending some PDFs and an Excel file to certain users. The flow works great; however, it is grabbing info from all of the Sharepoint items in the list.

 

How can I only grab the newest item?

Im assuming I need a filter query that will only grab an item made within the last minute (or so). Can someone help me with this? I have tried 

Created lt 'addMinutes(utcNow(), -1, 'yyyy-MM-ddTHH:mm:ssZ')'

This did not work. I believe I am close, but was wondering if I could get some help?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Only get newest Sharepoint item?

In Get Items set the ODAta Query to OrderBy Created desc and use top count of 1

 

Annotation 2019-10-12 093331.png

View solution in original post

Community Support Team
Community Support Team

Re: Only get newest Sharepoint item?

 

Hi @TBuente ,

 

You could use item ID to get the newest item, like:

61.PNG

Please take a try.

 

Best Regards,

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

5 REPLIES 5
Super User
Super User

Re: Only get newest Sharepoint item?

Hi @TBuente 

 

What is your trigger here? Can't you use the default Flow SharePoint triggers? Could you post a screenshot of your flow?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Super User
Super User

Re: Only get newest Sharepoint item?

In Get Items set the ODAta Query to OrderBy Created desc and use top count of 1

 

Annotation 2019-10-12 093331.png

View solution in original post

Super User
Super User

Re: Only get newest Sharepoint item?

Hi @TBuente 

 

You need the following expression

 

Created gt addMinutes(utcNow(), -1, 'yyyy-MM-ddTHH:mm:ssZ')
 
Please see below
 
gg1.png
 
Expression is as follows:
addMinutes(utcNow(), -1, 'yyyy-MM-ddTHH:mm:ssZ')
 
@Gristy  suggesion will always return one list record. So if you have more than one list created in the last minute it only returns one.
 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Super User
Super User

Re: Only get newest Sharepoint item?

correct, it returns the newest item as was the question 🙂

Community Support Team
Community Support Team

Re: Only get newest Sharepoint item?

 

Hi @TBuente ,

 

You could use item ID to get the newest item, like:

61.PNG

Please take a try.

 

Best Regards,

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

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

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 Solution Authors
Top Kudoed Authors
Users online (6,012)