web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Unable to sort (ascending order or descending order) autonumber field from power apps canvas app

(2) ShareShare
ReportReport
Posted on by 9
Hi ,
 
I'm facing issue in sorting the autonumber field(Dataverse Table) in canvas app Modern table control.
 
The Autonumber field doesn't contain any prefix and the string sequence is from 1
 
and i have added multiple records in Table and each record has generated an ID(Autonumber)
 
when i try to sort this in canvas app the sequence is not as expected (not proper sorting). 
 
Same when i have records which autonumber field starts with 1000 its(sorting) working fine.
 
My requirement is to have the ID from 1 not with 1000 or any other number.
 
please help in solving this issue
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,530 Super User 2025 Season 2 on at
    Good morning, afternoon, or evening :) depending on your location!
     
    The issue with sorting autonumber fields in Power Apps Canvas App seems to be related to how the data type is interpreted. Here are some steps and suggestions to address this:
     
    1. Data Type Issue: Autonumber fields are often treated as text fields rather than numeric fields. This can cause sorting to behave alphabetically instead of numerically. To resolve this, you can create a calculated column in Dataverse that converts the autonumber field to a numeric data type. Use this numeric column for sorting.
    2. Custom Sorting Logic: If creating a calculated column isn't feasible, you can implement custom sorting logic in your Canvas App. Use the Sort function with a formula that converts the autonumber field to a numeric value, such as Value(AutonumberField).
    3. Seed Value Adjustment: If the autonumber field starts from 1000, sorting works fine because the numbers are treated as text and align alphabetically. You can reset the seed value of the autonumber field to start from 1000 instead of 1. However, this might not meet your requirement of starting from 1.
    4. Power Apps Monitor Tool: Use the Power Apps Monitor tool to check if sorting is disabled on the grid control. Ensure the enableSorting property is set to true.
     
    Hope this helps some!
  • EP-14041627-0 Profile Picture
    9 on at
    Thanks Holly Huffman for Writing back and providing below steps
    1. Data Type Issue: AutoNumber fields are often treated as text fields rather than numeric fields. This can cause sorting to behave alphabetically instead of numerically. To resolve this, you can create a calculated column in Dataverse that converts the AutoNumber field to a numeric data type. Use this numeric column for sorting.
    • Yes I tried this but Calculated column cannot directly String value to integer, if you have any workaround to convert the data type pls help me with that
    1. Custom Sorting Logic: If creating a calculated column isn't feasible, you can implement custom sorting logic in your Canvas App. Use the Sort function with a formula that converts the AutoNumber field to a numeric value, such as Value(AutoNumber Field).
    • Yes for this I can get the data in order but when I try to sort this from the options In header again same issue occurs
    Additionally I have tried with cloud automate its working fine in copying the values between fields but the result is not in real time, since the automate takes time to execute and refreshing the Table data is not immediate
     
  • Suggested answer
    Inogic Profile Picture
    682 on at
    Hi,
     
    Yes, you can create a Formula Column field where you set the value from your Autonumber field, which can then be used for sorting rows in a Canvas app.
    You can use the following formula:
                      Value("Your Field Name")
    Note: This will create a field of Decimal type. To avoid showing decimal places, you can set the Decimal Places property to zero.
     
    Hope this helps!

    Thanks!
    Inogic
  • EP-14041627-0 Profile Picture
    9 on at
    Hi Inogic,
     
    Thanks for your input,
     
    I tried your recommended method when i try to use any function in calculated field its not allowing and showing Error "The VALUE function doesn't exist.".
     
    Is there any other way to achieve this?
  • Suggested answer
    Inogic Profile Picture
    682 on at
    Hi,
     
    It appears that the Calculate field type is not supported for this scenario.
    
    As we suggested, please create a Formula (Data type) Field with expression “Value(‘Your Field Name’) as outlined below.
     


    Additionally, we have a blog available that provides step-by-step guidance on how to create a Formula column. Reference link
     
    Hope this helps.
     
    Thanks!
    Inogic
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans