cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dittingbau
Level: Power Up

odata filter max value

Hi all,

 

I need to use the GETROWS function to get the row with the maximum row ID from my SQL table (including some other filter conditions but they run correctly). I can't find the correct odata expression for maximum value. 

I tried something like max(Column_name) but flow says this is an invalid expression.

 

Can anyone help me out?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: odata filter max value

 

Hi @Dittingbau ,

 

You only need to use the specified column in Order by to sort in descending order.

 

Then set the Top count to 1, then the Get rows action will return the row with the maximum value for the specified column.

 

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

2 REPLIES 2
Super User
Super User

Re: odata filter max value

Hi @Dittingbau 

 

Not sure that is supported in SQL ODATA.

 

Please see this post by @yoshihirok 

 

https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-get-max-value-of-rows-by-SQL-Serve...

 

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!



Community Support Team
Community Support Team

Re: odata filter max value

 

Hi @Dittingbau ,

 

You only need to use the specified column in Order by to sort in descending order.

 

Then set the Top count to 1, then the Get rows action will return the row with the maximum value for the specified column.

 

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

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,908)