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 / Trying to filter a lis...
Power Apps
Answered

Trying to filter a list by another list and picking values from there

(0) ShareShare
ReportReport
Posted on by 502

Hello everybody and a happy new year!

 

I'm absolutely struggling, but maybe I'm just missing something. 

I've got two Sharepoint lists. The first one (A) contains entries of Human Resources including three fields for Sharepoint Managed Metadata which represent the three hierarchic organization levels of my company (MM_1, MM_2, MM_3) and a fourth field (MM) that specifies which coworker is running those departments for everyone.

 

E.g.: Coworker1 has three metadata columns for department 1st, 2nd  and 3rd  level, each one single value, that specify which departments he belongs to. 4th field (MM) is blank.

 

Superior1 also has those columns (naturally) but department 1st level field is empty as he runs it (so MM field - multi value as there are coworkers who run several departments - contains the department 1st level he runs. Department 2nd and 3rd level field have values.

 

Superior2's fields MM_1 and MM_2 are empty, as he runs a department 2nd level which is given in MM.

 

The second one (B) includes vacation requests of coworkers. It's shown as a gallery in powerapps.

 

What I want to do is the following: 

1) I want to identify the currently logged in user and lookup in List A if he's got the permissions to see those vacation requests - i.e. that his MM field is not blank - and which ones, i.e. those from the department he's running.

2) I want to compare the coworker names in List A to the (identical) names in List B by each other to find out which departments of the 3 different levels the coworker belongs to.

3) I want to filter those vacation requests based on the levels of the currently logged in user - so coworker1 is only allowed to see the requests from department 1st level he runs, but coworker2 can see all those from department 2nd level.

 

Anybody got an idea how to build the filter function here? Help is much appreciated. 

 

Thanks

zaphod88

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

    Hi @zaphod88 ,

    1)Try this formula:

    Filer(listB, coworker_email in 
     Filter(listA,
     !IsBlank(MM),
     MM=LookUp(Superior1,coworker_email=User().Email,MM)
     ).coworker_email
     )

    2)Could you tell me what columns in listB that can represent department?

                                    how do you want to compare in details?

    3)Is coworker1 and coworker2 two specific user?

    If so , please try this:

      

    If(User().Email="coworker1 email",
     Filer(listB, coworker_email in 
     Filter(listA,
     !IsBlank(MM),
     MM=LookUp(Superior1,coworker_email=User().Email,MM)
     ).coworker_email
     ),
     User().Email="coworker2 email",
     Filer(listB, coworker_email in 
     Filter(listA,
     MM_2=LookUp(Superior1,coworker_email=User().Email,MM_2)
     ).coworker_email
     )
     )

     

     

     

    Best regards,

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard