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 gallery by user...
Power Apps
Answered

filter gallery by user and admin

(0) ShareShare
ReportReport
Posted on by 407

Hi, i have a gallery with a sharepoint data source and currently have the items of the gallery filtered so that user can only see what they created. However, i would also like to add an additional email address so that this user would be able to login and see all entries in the gallery. i thought maybe something like If(User().Email=user@bbb.com, true, Filter(KBXoffline, 'Created By'.Email = User().Email)

I currently have this in the items;
Filter(KBXoffline, 'Created By'.Email = User().Email)

 

Kind regards,
Matt383   


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

    @Matt383

     

    So you want to show all items for a particular user

     

    Use this in the Items property

     

    If(User().Email = varMyAdminEmail, KBXoffline, Filter(KBXoffline, 'Created By'.Email = User().Email))

     

    Place this somewhere else like OnStart

     

    Set(varMyAdminEmail, foo@foo.de)

     

    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.

  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    If you only have one admin that would but you would need to change true to KBXoffline. If you have more than one admin you might want to create a variable onStart called IsAdmin and set it to true if the the current user is part of your admin list.

     

    If(User().Email=user@bbb.com, KBXoffline, Filter(KBXoffline, 'Created By'.Email = User().Email)

    or 

    If(IsAdmin, KBXoffline, Filter(KBXoffline, 'Created By'.Email = User().Email)

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    I am very slow at typing. This is the second time I started to reply to a post with no response and when I finished my reply I see someone had already responded a minute or two earlier (and with a better answer). Sorry @PowerRanger , I don't mean to step on your responses. 

  • Matt383 Profile Picture
    407 on at

    Thanks, do i need to use double quotes around the email. Just getting an error without them  Set(varMyAdminEmail, "foo@foo.de") also to add additional users do i just use  Set(varMyAdminEmail, "foo@foo.de";"newuser@foo.de")

  • Matt383 Profile Picture
    407 on at

    Thanks for your solution, Just when i put in the email, it has an expected operator error on the email. Do i need to wrap the email in double quotes?

  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Matt383

     

    Yes you need double quotes. If you want more than 1 mailaddress the approach is somewhat different

     

    You have to use

    Set(varMyAdminEmail, ["mail1", "mail2" ])

     

    And the formular would be a "in" instead "="

    If(User().Email in varMyAdminEmail.... 

     

     

    Sorry it is somewhat difficult to write the complete Formular on a. Mobile so I have to shorten it

     

    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.

  • Matt383 Profile Picture
    407 on at

    Thanks, that works

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard