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 With Sear...
Power Apps
Unanswered

Sort Gallery With Search, Sort & Filter

(0) ShareShare
ReportReport
Posted on by

Hi, 

 

Can anyone help me, I have built an APP that has a gallery in that I would like to be able to search, sort and filter. 

I watched a video by Shane Young which help me create the gallery with searching and filtering, but I would also like to add sorting. 

 

I would like to be able to sort by date or kit, ascending or descending. 

 

My item formula on the gallery is as follows. 

 

Search(
If(
Filter_Recipe.Selected.Value = "All" And Filter_Status.Selected.Value = "All",
'POLY RUNS',
Filter_Recipe.Selected.Value = "All" And Filter_Status.Selected.Value <> "All",
Filter(
'POLY RUNS',
'Kit Status' = Filter_Status.Selected.Value
),
Filter_Recipe.Selected.Value <> "All" And Filter_Status.Selected.Value = "All",
Filter(
'POLY RUNS',
Recipe = Filter_Recipe.Selected.Value
),
Filter_Recipe.Selected.Value <> "All" And Filter_Status.Selected.Value <> "All",
Filter(
'POLY RUNS',
Recipe = Filter_Recipe.Selected.Value And 'Kit Status' = Filter_Status.Selected.Value
)
),
TextInput4.Text,
"RunNumber",
"Kit",
"Kit_x0020_Status",
"Works_x0020_Order_x0020_Head_x0020_1",
"Works_x0020_Order_x0020_Head_x0020_2","Recipe"
)

 

Can someone please help me with the code so I can add sorting via the date or kit number. I would also like to have these fucntions on a a button for each one. 

 

Thanks 

Categories:
  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @GrahamP44 ,

    Set "Date" or "Kit" as the Variable varSortField and your direction as varSortOrder and try this

    SortByColumns(
     Search(
     Filter(
     'POLY RUNS',
     (
     Filter_Status.Selected.Value = "All" ||
     'Kit Status' = Filter_Status.Selected.Value
     ) &&
     (
     Filter_Recipe.Selected.Value = "All" ||
     Recipe = Filter_Recipe.Selected.Value
     ),
     TextInput4.Text,
     "RunNumber",
     "Kit",
     "Kit_x0020_Status",
     "Works_x0020_Order_x0020_Head_x0020_1",
     "Works_x0020_Order_x0020_Head_x0020_2","Recipe"
     ),
     varSortField,
     varSortOrder
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard