cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
daroot
Resolver I
Resolver I

Drop-down List Lookup

Hi All,

I plan to filter a drop-down list based on current users.

The following table, get from another system(attached).

What I plan to is, when Jhon access the app, in the drop-down box only showing the list assigned to him, and the items assigned to Jenny will not showing on the drop-down list. Is it possible, and how to achieved this?

Thanks,



1 ACCEPTED SOLUTION

Accepted Solutions

The Filter function requires table or source name. Please see this: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

In your case, your DropDown (or ComboBox) Items property should be set to something like:

Filter(YourSourceName, Lower(Table1.AssignedTo) = Lower(User().Email

 

View solution in original post

7 REPLIES 7
dinusc
Microsoft
Microsoft

Hello @daroot,

You should be able to achieve this by using the following formula to populate the DropDown control:

Filter(YourSourceName, AssignedTo= User().Email)

That assumes that the email of the logged in user is the same as the one listed in your source.

Hi @dinusc,

 

I tried that suggestion but the dropdown list being empty. 😞 I am sure on the list current email have 3 assignment 

The possible reasons could be that email is different or formatted differently. You can check this by adding a temporary label control to your application and binding its "Text" property to User().Email and DropDown (or better yet ComboBox) control's "Items" property to your source directly (turn off filtering). This will allow you to compare the email addresses and understand the reason the filter does not work properly. Please note "Trim" and "Lower" functions that could be used for removing extra spacing and for performing a lower case comparison.

Will try it as your suggestion. Currently in the Assigned to field has the email like a users login, and what do you mean the different format. On the SPList assignedto field as a text type, it could be a problem?

I meant the way the email is in the AssignedTo field. For example, the AssignedTo may contain the email as MyEmail@MyDomain.com while User().Email may return myemail@mydomain.com in which case Lower(YourSourceName.AssignedTo) = Lower(User().Email) will address the issue. I've seen also cases when the email fields contain extra spaces in which case the "Trim" function should help.

Hi @dinusc,

 

I tried to put the Lower but got the error on the "=" here the functions :

Filter(Lower(Table1.AssignedTo) = Lower(User().Email)

 So, at the end is, I want in the dropdown will print the TicketTitle in the dropdown box.

IMG_20181031_201910.jpg

The Filter function requires table or source name. Please see this: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

In your case, your DropDown (or ComboBox) Items property should be set to something like:

Filter(YourSourceName, Lower(Table1.AssignedTo) = Lower(User().Email

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,378)