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 / add filter to gallery ...
Power Apps
Answered

add filter to gallery based on Dropdown and toggle

(0) ShareShare
ReportReport
Posted on by 26

hello,

I have the typical help desk application and I can already do filters based on a dropdown (which is based on the status of the request). Now I want to add a filter that adds to it (according to its state) based on a toggle. Depending on the state of this, I want to show or not the elements that are assigned to me (to the person ( isadmin) who is using the app at that moment).

In my gallery, in the "items" section I currently have this code.

***************

If
(isAdmin;
Sort
(Filter(AllTickets;TaskStatus.Value = Dropdown1.Selected.Value );
Created;Descending);
Sort
(Filter(AllTickets;Author.Email = MyProfile.Mail And TaskStatus.Value = Dropdown1.Selected.Value || Author.Claims = MyProfile.UserPrincipalName );
Created;Descending )
)

****************

ppblab77_2-1653602551429.png

 

ppblab77_0-1653602431949.png

column sharepoint

ppblab77_1-1653602496588.png

 

thanks!!

regards

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

    Hi @ppblab77 ,

    I am not entirely sure on your logic here, and also what value AssignedTo needs to match, but this would be the structure - the bracketing and &&/|| could change depending on the output you need.

    Sort(
     Filter(
     AllTickets;
     (
     IsAdmin ||
     (
     Author.Email = MyProfile.Mail ||
     Author.Claims = MyProfile.UserPrincipalName
     ) 
     ) &&
     (
     !Toggle1.Value ||
     AssignedTo.DisplayName = MyProfile.UserPrincipalName
     ) &&
     TaskStatus.Value = Dropdown1.Selected.Value
     );
     Created;
     Descending
    );

     

    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.

    Visit my blog Practical Power Apps

  • ppblab77 Profile Picture
    26 on at

    hello,

    first thank you. I think you have understood my question very well.

    I applied it and I only get an error, but I think I'm on the right track.

     

    ppblab77_0-1653605729533.png

    incompatible types for comparison. cannot compare these types: record, text

     

    tanks!!!!!🙂

  • WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    @ppblab77 ,

    See corrected post in this area

  • ppblab77 Profile Picture
    26 on at

    I had just solved it by calling a text type column and cloning it with the low that is triggered when it is modified.

    But your solution is much better, in my case it was .email

    Thanks friend!!!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard