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 II
Super User II

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (62,360)