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 / Sort gallery by custom...
Power Apps
Answered

Sort gallery by custom column with filter

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,

 

I am using this filter for my gallery however I wish to sort this Descending with the newest items at the top.

 

 

Filter(Register,
 (IsBlank(Search_textinput.Text) || Search_textinput.Text in 'Contract Ref' & 'External Party' & 'Contract Name' & 'Contract Description' & 'Contract tracking details' & 'Contract tracking date' & 'Contract Category'.Value
 ) &&
 (Directorate_dd.Selected.Result = "Directorate" || Directorate.Value = Directorate_dd.Selected.Result) &&
 (ContractStatus_dd.Selected.Result = "Contract Status" || 'Contract Status'.Value = ContractStatus_dd.Selected.Result
 ) &&
 (ContractCategory_dd.Selected.Result="Category" || 'Contract Category'.Value = ContractCategory_dd.Selected.Result)
) 


SortByColumns([DataSource], "Contract Ref", If(SortDescending1, Descending, Ascending))

 

 

I am figuring out how to sort this by the column 'Contract Ref'  (Descending).

 

Thanks,

Chris

Categories:
  • KvB1 Profile Picture
    1,596 on at

    Your Filter function should be inside the SortByColumns function, eg the filtered datasource is the datasource for your Sort function.

  • Verified answer
    sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    I managed to sort (no pun intended :D) it this way...

     

    Sort(
    Filter(Register,
     (IsBlank(Search_textinput.Text) || Search_textinput.Text in 'Contract Ref' & 'External Party' & 'Contract Name' & 'Contract Description' & 'Contract tracking details' & 'Contract tracking date' & 'Contract Category'.Value
     ) &&
     (Directorate_dd.Selected.Result = "Directorate" || Directorate.Value = Directorate_dd.Selected.Result) &&
     (ContractStatus_dd.Selected.Result = "Contract Status" || 'Contract Status'.Value = ContractStatus_dd.Selected.Result
     ) &&
     (ContractCategory_dd.Selected.Result="Category" || 'Contract Category'.Value = ContractCategory_dd.Selected.Result)
    ),
    ID,
    Descending
    ) 

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
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard