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

Sort for highest number breaks at 9

Hello,

 

I am creating an automated testing management app, which could auto-create reports, format workload and send out emails based on it.

 

For data storage I chose Excel tables, but faced the issue of creating an auto increment which is a vital part of any database.

The following function works well up to the integer 9, but when the record 10 is created it fails to give the correct highest number and instead shows 9: First(Sort(list_of_test_projects, ID, Descending)).ID

 

Issue overview:

Sort rangeFunction output
1 to 9Correct
10 and more9

 

Photo of list_of_test_projects table:

issue excel table.PNG

 

I did not use Max() as it is limited up to 2000 rows, as far as I remember.

 

Any thoughts on why this might be happening?

Cheers!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @DrMantas ,

I am not an Excel user but it sounds to me you have the numbers stored as Text, so the sequence would be 1,10,11...., 2,3,4,5,6,7..... Try

First(
   Sort(
      list_of_test_projects, 
      Value(ID), 
      Descending
   )
).ID

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

3 REPLIES 3
Super User III
Super User III

Hi @DrMantas ,

I am not an Excel user but it sounds to me you have the numbers stored as Text, so the sequence would be 1,10,11...., 2,3,4,5,6,7..... Try

First(
   Sort(
      list_of_test_projects, 
      Value(ID), 
      Descending
   )
).ID

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Super User III
Super User III

@WarrenBelz is correct here.

The alternative is to format the data type of your ID column as numeric from within Excel, and to then refresh your data source from the View > Data sources menu item in PowerApps.

Your app should then recognise the ID column as a number and there won't be any need for you to convert the ID value to a number in order to apply the correct numeric sort sequence.

Frequent Visitor

Thank you very much! It was indeed data type problem.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,861)