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 / Difficulty in Filterin...
Power Apps
Answered

Difficulty in Filtering Dropdown Values Based on Multiple User-Associated Records

(0) ShareShare
ReportReport
Posted on by 71

Hello,

I am currently facing an issue with Power Apps where I am unable to filter dropdown values based on multiple associated user records. Here's a brief overview of the problem:

I have an app where users are associated with specific roles and countries, and I am trying to filter dropdown values based on these associations. The issue arises when attempting to display all associated records for a specific user, role, and country in the dropdown. Currently, the filtering logic is only displaying a single record, and I need it to display all the associated records.

Here's an example of the code I'm currently using in the OnVisible property of the screen and for the dropdown:

 

OnVisible Property:

 

ClearCollect(
colFilteredClans,
Filter(
ClansAssociations,
Country.Value = varAssociatedCountry &&
ClanID.Value in LookUp(
Users,
EmailAddress.Email = User().Email &&
Roles.Value = varUserRole &&
UserCountryID.Value = varAssociatedCountry
).ClanID.Value
)
);

 

Dropdown:

Distinct(colFilteredClans, IDClanes.Value)

 

In the code, the varAssociatedCountry variable should be dynamically determined based on the user's context. 

I've attempted various adjustments to the logic, including using ForAll and Filter functions, but I haven't been able to achieve the desired result. I need the dropdown to display all the associated values for the user based on the provided criteria.

How can I adjust the code to ensure that all associated records are correctly displayed in the dropdown?

 

Thank you for your assistance.

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,570 Most Valuable Professional on at

    Hi @galvang ,

    The fundamental issue I believe is that you are using a LookUp instead of a Filter in the related query. I am assuming your data source is SharePoint here - try this

    With(
     {
     _User:
     Filter(
     Users,
     EmailAddress.Email = User().Email &&
     Roles.Value = varUserRole &&
     UserCountryID.Value = varAssociatedCountry
     )
     },
     ClearCollect(
     colFilteredClans,
     Ungroup(
     ForAll(
     _User As _Data,
     Filter(
     ClansAssociations,
     Country.Value = varAssociatedCountry &&
     ClanID.Value = _Data.ClanID.Value
     )
     ),
     "Value"
     )
     )
    );

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard