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 / Distinct + Filtering D...
Power Apps
Answered

Distinct + Filtering Dropdown based on User Email

(0) ShareShare
ReportReport
Posted on by 516

Hello there, 

 

I have this requirements that i need to filter dropdown control based on user email. but here are the conditions. 

How can i filter only allowed values in the dropdown box based on the user email. I need the manager to see only their location based on their email.

 

Example

User1@microsoft.com can only see "Orlando" in the dropdown list. Cannot see the Tampa, Fort Lauderdale, etc.

User2@microsoft.com can only see "Tampa" in the dropdown list cannot see other values. 

 

here is my view requirements

ManagerLocation
User1@microsoft.comOrlando
User2@microsoft.comTampa
User3@microsoft.comJupiter

 

Here is my dropdown view. 

locations1.PNG

 

Below is my code.. but there is an error. but maybe there are much better code out there. 

Distinct(Filter(tblData, User().Email = "User1@microsoft.com") Location)

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @echodapogi 

    Is Location expected to have duplicate values?  If not, then Distinct is not needed.

     

    Your items property should be the following:

    Filter(
     Distinct(
     Filter(tblData, User().Email = "User1@microsoft.com"),
     Location
     ),
     !IsBlank(Result)
    )

     

    If you do not have duplicates in Location, then it can simply be:

    Filter(tblData, User().Email = "User1@microsoft.com")

     

    I hope this is helpful for you.

  • echodapogi Profile Picture
    516 on at

    Thanks Randy. After typing the code. my dropdown value is not showing. No errors. Its just empty. 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @echodapogi 

    First - is this a Dropdown control or a Combobox control?  They are both different.

  • echodapogi Profile Picture
    516 on at

    Randy, 

     

    this code worked but i don't think this is the best code. maybe you have another much better idea. and only works. for orlando. and its a dropdown by the way.. Thanks you for looking into it. 

     

    If(
     User().Email = "User1@microsoft.com",
     Distinct(
     Filter(
     tblData,
     Location = "Orlando"
     ),
     Location
     ),
     Distinct(
     tblData,
     Location
     )
    )

     

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @echodapogi 

    Well, you're introducing a new factor to this...with the comparison.

     

    But no - that formula is not very effective.

     

    If the data is as you posted, then my response with the formulas applies.  

    If you have duplicate locations for a user and want distinct, then use the first formula.  If there are no duplicates, then use the second one.

     

    As for the dropdown, make sure that you have the proper field that you want displayed in the list to be set in the "View" property in the property pane (on the right).

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard