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 / Matching logged in use...
Power Apps
Unanswered

Matching logged in user with two SharePoint Lists

(0) ShareShare
ReportReport
Posted on by 45

Hi,

I am new to Power apps and currently struggling with one issue. I have two SharePoint lists where one of them (say SP list "A")  is for the support tickets whereas the other one (say SP list "B") is for the people who will be looking after the tickets. List A has various columns and one of them is the facility that the ticket belongs to. The list B has the user's full name, email, department and facility they belong to. One facility can have multiple users in list B.

What I am trying to do is, when the user is logged in to the app, then we know the facility where they belong from the SharePoint list B and then they see the tickets that belong to their facility only from list A on the screen. I know I am doing wrong here but just wanted to show the below formula that I tried:
if(!IsBlank(LookUp(User().Email = B[@Email]), Filter(activetickets,!IsBlank(LookUp(B,Facility=activetickets[@Facility]))))

Your help would be greatly appreciated.

Thank you!

Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    First thing to do would be to grab the item from list B and save it locally so you have that users info. To do that use the following -> Set(currUser, LookUp(ListB, FullName = User().FullName)) or something along these lines. This will give you an object called currUser that will allow you to access the fields for the user as needed. 

    Next you are wanting to show only that user's tickets for that building/location in a gallery. The following code should help you there: 

    Filter(ListA, Facility = currUser.Facility And AssignedTo = currUser.FullName)

    What this is doing is saying only show me the items from listA where the facility is the same and the name is the same as this current user. Hope this helps!

  • apanta Profile Picture
    45 on at

    Hi mmollet, 

    Thank you for this. It worked. But as I mentioned one user can have multiple facilities, when I tried this, it only showed me one Facility tickets rather than two. For example, I entered my details on two rows on the SP list "B" for two different facilities, the gallery gave me the tickets of only one facility that I entered first but not the second facility's tickets.

    Hope this is clear.

    Regards,

  • mmollet Profile Picture
    3,187 on at

    Oh ok thats probably because of this part: Filter(ListA, Facility = currUser.Facility And AssignedTo = currUser.FullName) 

     

    This will limit what is returned to one facility. If you want all that user's facilities then just remove what is in red and the 'And' operator. That will then look through ListA and return any facilities for that username.

  • apanta Profile Picture
    45 on at

    Hi mmollet,

    I don't want to use the AssignedTo filter here because some of the tickets might not be assigned to any users at first. What I want to do is, when the person X who belongs to facility A, B and C open the app, the gallery gets filtered out and only show the tickets that belongs to the facilities A, B and C irrespective of the AssignedTo field. This is because this person X is monitoring all his three facilities tickets.

    In sharepoint list B, the person X has the items as below:

    Full NameEmailFacility
    X Smithx.smith@gmail.comA
    X Smithx.smith@gmail.comB
    X Smithx.smith@gmail.comC


    What I want to do is store all these facilities details for X Smith and filter out the gallery based on user().fullname.

    I am not sure, may be on the first formula you mentioned "Set(currUser, LookUp(ListB, FullName = User().FullName))", it is storing only facility "A" for X smith. I want to store all facilities (A,B and C) for X smith.

    Hope I am clear with my query.

    Thank you!

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 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard