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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sorting in descending ...
Power Apps
Unanswered

Sorting in descending order

(1) ShareShare
ReportReport
Posted on by 90

hi Expert i have a gallery trying to sort 

 

code i have  

With({_items: SortByColumns(
 Filter(Opportunity, "ID",
 country= CTDDL_5.Selected.Result|| CTDDL_5.Selected.Result=Blank(),
 remediationstatus=stageDDL_5.Selected.Result||stageDDL_5.Selected.Result=Blank()
 ), "opportunityname","opportunitydescription","Title", If(SortDescending1,SortOrder.Ascending,SortOrder.Descending)
 )
 }, 
 Filter(
 _items, TextInput3_5.Text in opportunitydescription|| TextInput3_5.Text in opportunitynumber||TextInput3_5.Text in referenceid
 )
)

 i want to sort the gallery based on latest id.  my latest id is 49 but its random

 

Vedant28_0-1719936807660.png

 

 

Categories:
I have the same question (0)
  • developingteal Profile Picture
    392 on at

    do something like Sort(table, ID, sortorder.descending)

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Vedant28,

     

    Thank you for providing the code snippet and screenshot! 😊

     

    The currenct code was sorting based on multiple columns with a conditional ascending / descending value. Additionally, the text value ID was written as a Filter parameter - not as a SortByColumns parameter.

     

    In case you only want to sort the datasource descendingly based on ID, you can use the code below:

    With(
     {
     _items: Filter(
     Opportunity, 
     country = CTDDL_5.Selected.Result || CTDDL_5.Selected.Result=Blank(),
     remediationstatus = stageDDL_5.Selected.Result || stageDDL_5.Selected.Result=Blank()
     )
     }, 
     Sort(
     Filter(
     _items, 
     TextInput3_5.Text in opportunitydescription || TextInput3_5.Text in opportunitynumber ||TextInput3_5.Text in referenceid
     ),
     ID,
     SortOrder.Descending
     )
    )

     


    If this solves your question, would you be so kind as to accept it as a solution✔️

    If you liked my solution, please give it a thumbs up👍

     

    Connect with me: LinkedIn | Blog

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard