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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sorting ID number in g...
Power Apps
Answered

Sorting ID number in gallery from Excel sheet

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there. 


So I have a gallery set up in Power Apps that sorts on Ticket ID to always have the newest ticket at the top of the app. 

 

Problem I am facing is, that I now have 10 + tickets and the sorting on ID now goes like this from bottom to top: 1,10,11,2,3,4,5,6,7,8,9 instead of 1,2,3,4,5,6,7,8,9,10,11

 

The gallery gets its ID info from a excel sheet where ID isn't configured as numbers, but just "standard".

 

This is the gallery code: 

 

Sort(
Search(TicketsCollect; TextInput2.Text; "Accountname";"Description";"Subject"; "Priority"; "Owner");
ID;Descending)

 

This is the code used to save to the excel sheet

 

Collect(TicketsCollect;{ID:Text(Max(TicketsCollect;ID)+1);Owner:Dropdown1.SelectedText.Opretter;Accountname:ComboBox1.Selected.Name;Priority:Dropdown2.SelectedText.'Work Area';Subject:TextInput1.Text;Description:TextInput4.Text;DateCreated:Text(Today())});;

 

So the question probably boils down to:

 

How do i get my Gallery to function so highest ID is shown first and then in descending order from there.

 

Thank you in advance 

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @Anonymous ,

    Have you tried

    Sort(
     Search(
     TicketsCollect; 
     TextInput2.Text; 
     "Accountname";
     "Description";
     "Subject"; 
     "Priority"; 
     "Owner"
     );
     Value(ID);
     Descending
    )

    There are other solutions - try this simple one first

     

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    So simple when you post it. 

     

    Thank you very much, that did the trick 🙂

     

    -ABK

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard