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 / View PowerApps Gallery...
Power Apps
Answered

View PowerApps Gallery User Specific

(0) ShareShare
ReportReport
Posted on by 697

Hello,

 

I'm looking to show items in the Gallery as per system users.

 

As  an Admin, all the items should be visible for me within the Gallery, whereas if Person "A" logs into the App, he should see only the items that are created by him/her.

 

I'm using below formula for the gallery items, to filter the gallery as per UniqueID into the search box

 

SortByColumns(Search(SPName, TextInput1.Text,"UniqueID" , "Title"),"Modified",Descending)

 

I tried formatting the formula as below, but does not seems working:

 

 

SortByColumns(Search(SPName, TextInput1.Text,"UniqueID0" , "Title"),"Modified",Descending); Filter(SPName,email = User().Email)

 

Categories:
I have the same question (0)
  • v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @Prem4253 ,

     

    Maybe you could try the following formula:

     

    SortByColumns(Search(
    If(User().Email="Admin@email.com",SPName,Filter(SPName,User().Email='Created By'.Email)),
    TextInput1.Text,"UniqueID0" , "Title"),"Modified",Descending)
    

     

     

    Best Regards,

    Charlie Choi

     

     

     

     

  • Prem4253 Profile Picture
    697 on at

    HI @v-yujincui-msft 

     

    just wanted to check, if applying the formula provided by you., will the user i.e. "Admin@email.com" (mentioned in the formula) will have full access to all submitted records and rest of the users, will have access to their submitted records.

  • v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @Prem4253 ,

     

    Maybe you could do a test on your side using this formula and it works on my side.

     

     

    Best Regards,

    Charlie Choi

  • JaguarMonkey Profile Picture
    71 on at

    I have done this several times. I set a field called User, which can be set to be updated by User().FullName or User().Email when the records are created.

     

    Then the Gallery filters like so

    SortByColumns(Filter(DataSource, Name = User().FullName),"SortingColumn",Descending)

     

    I set a second Gallery with the Visible criterion set to true only for the Admin.  I have chosen to separate the approach because I have other controls that I want the Admin to use.  This leads to less clutter, albiet, a few more components.

  • Prem4253 Profile Picture
    697 on at

    Hi,

    I updated the formula with adding 2 more users i.e. User@email.com and someone@email.com, but this 2 users do not see all the items into the gallery.

    SortByColumns(Search(
    If(User().Email="Admin@email.com" || "User@email.com" || "someone@email.com" ,SPName,Filter(SPName,User().Email='Created By'.Email)),
    TextInput1.Text,"UniqueID0" , "Title"),"Modified",Descending)

     

    Whereas I am the Owner of the App, so I could see all the items submitted by all the users into my Gallery.

     User@email.com and someone@email.com are the Co-Owner of the app.

     Please advise - all the users mentioned in the formula should see all the items submitted by the users.

  • Prem4253 Profile Picture
    697 on at

    Hi,

    I updated the formula with adding 2 more users i.e. User@email.com and someone@email.com, but this 2 users do not see all the items into the gallery.

     

    SortByColumns(Search(
    If(User().Email="Admin@email.com" || "User@email.com" || "someone@email.com" ,SPName,Filter(SPName,User().Email='Created By'.Email)),
    TextInput1.Text,"UniqueID0" , "Title"),"Modified",Descending)

     

     

    Whereas I am the Owner of the App, so I could see all the items submitted by all the users into my Gallery.

     User@email.com and someone@email.com are the Co-Owner of the app.

     Please advise - all the users mentioned in the formula should see all the items submitted by the users.

  • WarrenBelz Profile Picture
    155,922 Most Valuable Professional on at

    Hi @Prem4253 ,

    Try this

    With(
     {
     wAdmin:
     User().Email = "Admin@email.com" || 
     User().Email = "User@email.com" || 
     User().Email = "someone@email.com"
     },
     SortByColumns(
     Search(
     Filter(
     SPName,
     wAdmin || User().Email='Created By'.Email
     ),
     TextInput1.Text,
     "UniqueID0", 
     "Title"
     ),
     "Modified",
     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

  • Prem4253 Profile Picture
    697 on at

    Users mentioned in the formula are able to view all the records, but everyone who opens the form, see below error:

    Prem4253_0-1669201137565.png

    Not sure what is this error.

     

  • WarrenBelz Profile Picture
    155,922 Most Valuable Professional on at

    @Prem4253 ,

    Not sure why that is as the code is valid structure - is that the exact code you used (please post yours in Text). In the meantime, try this variation

    With(
     {
     wAdmin:
     User().Email = "Admin@email.com" || 
     User().Email = "User@email.com" || 
     User().Email = "someone@email.com"
     },
     SortByColumns(
     Filter(
     SPName,
     (
     wAdmin || 
     'Created By'.Email = User().Email
     ) &&
     (
     TextInput1.Text in UniqueID0 || 
     TextInput1.Text in Title
     ) 
     ),
     "Modified",
     Descending
     )
    )

     

  • Prem4253 Profile Picture
    697 on at

    I used the same formula which was posted by you earlier :

     

    With(
     {
     wAdmin:
     User().Email = "Admin@email.com" || 
     User().Email = "User@email.com" || 
     User().Email = "someone@email.com"
     },
     SortByColumns(
     Search(
     Filter(
     SPName,
     wAdmin || User().Email='Created By'.Email
     ),
     TextInput1.Text,
     "UniqueID0", 
     "Title"
     ),
     "Modified",
     Descending
     )
    )

    Just update the SPName to my SharePoint list name.

    and in User().Email = "Admin@email.com" - i mentioned the person email address who should be able to view all the submitted records into gallery

     

    your recent code also does not seems to be working:

    With(
     {
     wAdmin:
     User().Email = "Prem@someone.com" || 
     User().Email = "Tony@someone.com" || 
     User().Email = "Gally@someone.com"
     },
     SortByColumns(
     Filter(
     AllocationBilling,
     (
     wAdmin || 
     User().Email='Created By'.Email
     ) &&
     (
     TextInput1.Text in UniqueID0 || 
     TextInput1.Text in Title
     )
     )
     ),
     "Modified",
     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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard