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 Apps
Answered

Filter by sort by

(0) ShareShare
ReportReport
Posted on by

I need to filter a gallery by a sort by with 3 options: 

 

- recent data

 

- Maintenance order

 

- % complete

 

 

Is it possible?

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

    Hi @Gorilla_8 ,

    Just add them together 

    Filter(
     YourDataSource(
     RecentData = xxxxx &&
     MaintenanceOrder = xxxx&&
     %Complete = xxxx
     )
    )

    obviously the criteria can be any valid search, taking into account delegation issues.

     

    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

  • Gorilla_8 Profile Picture
    on at

    But i need to add here: 

     

    Example: 

     

    If the user clicks on> Recentdata show the recent data

     

    if the user clicks on> MaintenanceOrde show the maintencande order

     

    if the user clicks on> % complete show by the %complete

     

    On this code: 

     

    If(
     Text(drpFilter.SelectedText.Value) = "Todos";
     UpdateContext(
     {
     varVisiblity: false;
     galleryHeight: 857;
     yPosition: 279
     }
     );;
     ClearCollect(
     collTaskListForGallery;
     collTasksListByProjectID
     );
     UpdateContext(
     {
     varVisiblity: true;
     galleryHeight: 781;
     yPosition: 345
     }
     );;
     Switch(
     Text(drpFilter.SelectedText.Value);
     "Nome do Recurso";
     UpdateContext(
     {
     varFilterColumnName: "Nome do Recurso";
     varHintText: "Nome do Recurso"
     }
     );
     "Local de Instalação";
     UpdateContext(
     {
     varFilterColumnName: "LOcaldeInstalação";
     varHintText: "Local de Instalação"
     }
     );
     "Ordem de Manutenção";
     UpdateContext(
     {
     varFilterColumnName: "OrdemdeManutenção";
     varHintText: "Ordem de Manutenção"
     }
     );
     "Equipamento";
     UpdateContext(
     {
     varFilterColumnName: "Equipamento";
     varHintText: "Equipamento"
     }
     )
     )
    );;
    UpdateContext({varDefault: true});;
    UpdateContext({varDefault: false})
  • Verified answer
    WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @Gorilla_8 ,

    You used the words both Filter and Sort in your post - I responded to the assumption of Filter, however from your code, you are wanting to Sort.

    You are using a variable varFilterColumnName  - I assume this is a sort order in the Items property of the gallery.

    If this is all true, then your code should do the job.

    One question - ComboBox drpFilter - the output of this would normally be drpFilter.Selected.xxxx (with xxxx being Value, Result or a field name depending on the Items property).

     

    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.

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 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard