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 range | Function output |
1 to 9 | Correct |
10 and more | 9 |
Photo of list_of_test_projects table:
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!
Solved! Go to Solution.
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.
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.
@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.
Thank you very much! It was indeed data type problem.
User | Count |
---|---|
148 | |
93 | |
82 | |
77 | |
57 |
User | Count |
---|---|
197 | |
175 | |
103 | |
95 | |
89 |