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 / Filter Users with an Icon
Power Apps
Answered

Filter Users with an Icon

(0) ShareShare
ReportReport
Posted on by 159

Hi

I have an app with a gallery view. When the user open the app, they can see all the entries but Id like to them to be able to press an icon and then they can only see their own entries. 

 

I have this in Items for gallery: 

 Sort(Filter('Timeopgørelse samt kilometer - prototype';Author.Email=User().Email); Dato ;Descending)

How do I make an icon perform that?
And then possibly have a second icon that brings back the original view?

Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

     

    Hi @IzabEwa

     

    Icon Onselect 

    UpdateContext({IsAll: !IsAll})

     

    Filter condition based on current user

     

     

    With(
     {sData: IssueTracker},
     If(
     IsAll,
     Filter(
     sData,
     'Assigned to'.Email = User().Email
     )
     )
    )

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @IzabEwa 

    Icon OnSelect

    Set( vUser; !vUser)

     

    Gallery Items

    If( vUser;

     

    // Show users items

    Sort(Filter('Timeopgørelse samt kilometer - prototype';Author.Email=User().Email); Dato ;Descending);

     

    // else show all items

    Sort('Timeopgørelse samt kilometer - prototype'; Dato ;Descending)

    )

  • IzabEwa Profile Picture
    159 on at

    what does wCode stand for here?

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Just a variable.

    StalinPonnusamy_0-1628857668247.png

     

     

     

  • IzabEwa Profile Picture
    159 on at

     

    // else show all items

    Sort('Timeopgørelse samt kilometer - prototype'; Dato ;Descending)

    )


    I dont need to include this part right ?

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    My bad, Here is get all if not

    With(
     {wCode: IssueTracker},
     If(
     IsAll,
     Filter(
     wCode,
     'Assigned to'.Email = User().Email
     ),wCode
     )
    )
  • IzabEwa Profile Picture
    159 on at

    would you mind explaining your notation ?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, if you want to toggle between ALL items and USER items

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Icon

    • Icon switches from ON to Off or Off to ON
    •  
    • Filter
    • Bind Source to variable wCode
    • If toggle selected, filter it. if not bring all
    • Finally sort the result
    With(
     {wCode: IssueTracker},
     Sort(
     If(
     IsAll,
     Filter(
     wCode,
     'Assigned to'.Email = User().Email
     ),
     wCode
     ),
     Created,
     Descending
     )
    )

     

     

  • IzabEwa Profile Picture
    159 on at

    yes i meant that i dont repeat it again , so the code doesnt end up looking : 

    If(vUser; Sort(Filter('Timeopgørelse samt kilometer - prototype';Author.Email=User().Email); Dato ;Descending)Sort('Timeopgørelse samt kilometer - prototype'; Dato ;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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard