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
Unanswered

Gallery Filter

(1) ShareShare
ReportReport
Posted on by 82

Hi,

 

I am trying to filter a gallery based on company names assigned to users.

Below is my sharepoint list

 

CompanyUser Email
ABCdef@jhd.com
JHLikj@kjs.com
POWdef@jhd.com

 

One user can belong to multiple companies.

 

How can I filter my Gallery to display companies ABC and POW if user def@jhd.com logs in. 

I tried creating a variable using LookUp function but it only picks up the first company in the list.

 

I have tried both Variables and Collections as below on Gallery Items Event: 

 

Set(varUser,User().Email)

Variable - CompanyTitle
Set(CompanyTitle,LookUp(App_Access,Title=varUser,Company.Value))

On Gallery Items Event:

 

Filter(IAForm, StartsWith(Ref_ID,TextInput1_1.Text) && Company.Value in CompanyTitle , Not(Ref_ID exactin Title4.Text)) 

 

 

Collection: Company Access

ClearCollect(CompanyAccess,Filter(App_Access, Title = varUser)

 

On Gallery Items Event:

 

Filter(
 IAForm,
 StartsWith(
 Ref_ID,
 TextInput1_2.Text
 ) && Company.Value in Concat(CompanyAccess,Company.Value) , Not(Ref_ID exactin Gallery1_6.AllItems.Title) Or Not(Ref_ID exactin Gallery1_7.AllItems.Title)
)

 


 Please advise.

@RandyHayes 

@ShaneYoung 
@WarrenBelz 

Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @PowerDigitize_1 

     

    1. Note that a LookUp only returns one Record. This might be your main problem. Your other given formulas also seem to be expecting just one value, not multiple possible values, all of this may also need to be revised.

     

    2. Also, there may be multiple things going on, see if at least temporarily focusing on only the filtering of Company by User helps before trying anything else.

     

    3. Try something like this for Items property of a brand new Gallery to start (make a new Vertical Gallery by going to Insert -> Vertical Gallery), and have the Data source pointing to App_Access). 

     

    //pseudo formula adjust as needed
    Filter(App_Access, Title = User().Email)

     

    If you have any issue and assuming your SharePoint List always uses lowercase for e-mail, you can try the below instead (but the above is preferred to the below if possible):

     

    //pseudo formula adjust as needed
    Filter(App_Access, Title = Lower(User().Email))

     

    I do not recommend doing Lower(Title), this may cause a delegation warning, and is not recommended.

     

    4. Just try the above by itself. See if you get a Gallery containing only the two companies. See if this works.

     

    5. There is a lot going on otherwise, and I won't advise you about it for now. I would like you to check to see if you can get only the two companies ABC and POW based on the logged in user being def@jhd.com. 

     

    6. By the way, if you have any issue with any steps above, try it again and use this hard-coded email version of the formula to test first:

     

    //pseudo formula adjust as needed
    Filter(App_Access, Title = "def@jhd.com")

     

    Then try it with User().Email after that, just to be sure. If the above works, but does not work with User().Email, then you are not logged in as the right user.

     

    If even the above hard-coded email version of the formula does not work, check if Title is really the name of the User Email column of your SP List, and that App_Access is really the right data source pointing to the User Email and Company SP List you gave as an example in the very beginning of your original post, adjust anything appropriately (if needed), then try it again, starting with the hard coded e-mail version first and going from there.

     

    See if it helps @PowerDigitize_1 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard