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 Function with m...
Power Apps
Answered

Filter Function with multiple Source Dependence

(0) ShareShare
ReportReport
Posted on by 102

Hi Everyone,

 

I had been using PowerApps for longer more than a month now; I am not a developer on my daily basis but still remember some from ages ago.

 

In this case, I want to filter a Sharepoint List on a Drop Down List based on another Sharepoint List.

  • The first list is named "Locations; with columns ID (integer), Name, Active_Location (True/False), and Address.
  • The second list is named "Supervisor", and it's columns are ID, Location_ID (integer), Location_Name, and Supervisor_Email.
    • This List has every supervisor that has had every location, so it must be sorted in order to display the newest Supervisor of each location.

Knowing this, my app has one screen where the supervisor shall add a new "Supervisor Visit to a Location" where the users have one DropDownBox where I want to Filter/Display ONLY the locations where they are the Supervisors.

 

I would appreciate any support on this.

 

- First Edit:

Another approach for this could be to Filter the Sharepoint List "Locations" based in other Sharepoint List named "Supervisor" with something like this:

 

  • Filter(Locations, ID in Search(Supervisor, CurrentUser.Mail, "Supervisor_Email")).Name

Knowing that CurrentUser comes from:

  • Set(CurrentUser,Office365Users.MyProfile());

But this is still not working either

Categories:
  • OSBSoto Profile Picture
    102 on at

    Another approach for this could be to Filter the Sharepoint List "Locations" based in other Sharepoint List named "Supervisor" with something like this:

     

    • Filter(Locations, ID in Search(Supervisor, CurrentUser.Mail, "Supervisor_Email")).Name

    Knowing that CurrentUser comes from:

    • Set(CurrentUser,Office365Users.MyProfile());

    But this is still not working either

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @OSBSoto :

    Could you tell me what the field in Locations corresponds to in Supervisor?

    I assume it is Location_ID.

    The point is the definition of operator β€˜in’ is "Belonging to a collection or a table".But ID does not belong to Search(Supervisor, CurrentUser.Mail, "Supervisor_Email")

    Please try :

    Filter(Locations, ID in Search(Supervisor, CurrentUser.Mail, "Supervisor_Email").Location_ID).Name

    Best Regards,

    Bof

  • OSBSoto Profile Picture
    102 on at

    Hi @v-bofeng-msft 

     

    You are right; that's the Location_ID; with this, I can solve this, thanks to you. I will mark your answer as the Solution for this.

     

    But also, this solution made me ask another question associated with:

    On the Sharepoint List "Supervisor" is store every single supervisor that had been monitoring a Location; they rotate as their Manager wishes. Could I Filter this solution for display ONLY the Locations that have not another Supervisor assigned before another?

     

    Let say:

    Table Locations

    IDNameActiveAddress
    1Contoso HQYes…
    2Contoso West CoastNo…
    3Contoso East CoastYes…
    4Adventure WorksYes…

     

    Table Supervisor

    IDLocation_IDLocation_NameSupervisor_Email
    11Contoso HQtim@consoto.com
    21Contoso HQbob@contoso.com
    32Contoso West Coasttim@consoto.com
    43Contoso East Coasttim@consoto.com
    54Adventure Works HQbob@contoso.com
    64Adventure Works HQtim@consoto.com

     

    With the current formula for Items, If Tim@contoso.com uses the Screen, will see the Location with ID = 1, "Contoso HQ", which have a bob@consoto.com as the actual Supervisor. The same goes for Bob, who's going to see Adventure Works HQ even when he's not the current Supervisor.

     

    Any idea? Or suggest creating this as a new topic as the original one is already solved?

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

    Hi @OSBSoto :

    I suggest you creating this as a new topic.

    If you are in a hurry to solve this problem, maybe you can try this formula:

     

    Filter(
     Locations, 
     ID in Search(ForAll(Distinct(Supervisor,Location_ID),Last(Filter(Supervisor,Result=Location_ID))), CurrentUser.Mail, "Supervisor_Email").Location_ID
    ).Name

     

    Best Regards,

    Bof

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