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

Get only the newest sharepoint list item if there are duplicates

Hi guys,

I'm currently implementing a flow for our expenses list.

For every monthly recurrent expense it's supposed to create a new entry every month until the usage period is reached.

The recurrent expense will have the same Identifier as the initial entry e.g. "IT-REF-0016".

I'm stuck cause I don't know how to get only the newest item if the Identifier occurs more than once.

Thanks for the help!

Simon

 

flow_mrc.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @simonschork ,

 

It seems that you need to group items first, and then filter out the newest list item based on Created or item ID:

Please check this blog and see if it helps:

http://johnliu.net/blog/2018/6/do-group-by-in-flow-with-two-simple-elegant-loops

 

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

3 REPLIES 3
ChristianAbata
Super User
Super User

hi @simonschork  Maeby you could use the created date of item, so then you can  compare items by date.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Hi @ChristianAbata, thanks for the answer!

My first attempt was to order the the returned items by "Created on" descending and pick the top 1.

But in this case it obviusly only returns the latest items. I guess I have to use an expression within the "Filter Query" field of "Get items" but I have no clue how to syntax these right nor did I find a fitting function for my case on the Reference guide for functions in the documentation.

Do you have an example for this kind of expression or filter query?

Maybe I also make things a little to complicated and there is an easier way. I'm quit new to Flow.

 

Edit: Another attempt could be comparing ID and only keeping the higher one, but I'm still stuck on how to compare items with same value in the identifier column.

 

Hi @simonschork ,

 

It seems that you need to group items first, and then filter out the newest list item based on Created or item ID:

Please check this blog and see if it helps:

http://johnliu.net/blog/2018/6/do-group-by-in-flow-with-two-simple-elegant-loops

 

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,516)