cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Graves_7
Level: Powered On

Get Records that have current user in Column

I have a SharePoint list that contains a list of Customers and the Salesperson assigned to each customer.  I want to populate a dropdown with the customers assigned to the current user.  I have tried the formula below, but I keep getting the error "The property expects table values, but this rule contains incompatible text values.".

 

This is the formula I have used.

 

LookUp('CUSTOMER (TEST)',User().FullName=Salesperson,Name)

 

I have also tried putting the Saleperson name in the formula like this and get the same error.

 

LookUp('CUSTOMER (TEST)',"John Doe"=Salesperson,Name)

 

Here are the columns in my Sharepoint list

 

Name  Address1  Address2  City  State  Zip  Salesperson

 

Anyone have any idea how I can accomplish this?

1 ACCEPTED SOLUTION

Accepted Solutions
Steelman70
Level 10

Re: Get Records that have current user in Column

Try this...

MyDropDown.Items = ShowColumns(Filter('CUSTOMER (TEST)', User().FullName=Salesperson), "Name")

 

 

PS You may want to put User()FullName in a context variable or in a textbox since otherwise there will be a call to detect the current user every time the function is called.  This will affect performance 

View solution in original post

5 REPLIES 5
Steelman70
Level 10

Re: Get Records that have current user in Column

Try this...

MyDropDown.Items = ShowColumns(Filter('CUSTOMER (TEST)', User().FullName=Salesperson), "Name")

 

 

PS You may want to put User()FullName in a context variable or in a textbox since otherwise there will be a call to detect the current user every time the function is called.  This will affect performance 

View solution in original post

Graves_7
Level: Powered On

Re: Get Records that have current user in Column

Thank you...worked like a charm!

kruismanp
Level: Powered On

Re: Get Records that have current user in Column

Hi Steelman70,

 

I've a simular filter based on User().Email to filter a datasource (cdm, ~3000 records) to only show the records of the current user. This is extremely slow (minutes) and returns only findings from the first 500 records 

Although not an acceptable solution, if I replace the User().Email with text of an actual email the retrieval time is acceptabel and it retrieves all records that comply with the filter. 
The solution given in this thread, using a context variable that in my case has the value of User().Email is not an option  ( I think.. ) but do you have some other suggestions?

 

Regards Peter

Highlighted
Steelman70
Level 10

Re: Get Records that have current user in Column

Hi Peter,

you can use a context variable or you can have a text box (and hide it) with the User().Email as text property.  Then the filter can refer to the context variable or the text box's text value.  Either of these approaches should improve performance significantly.

I am surprised that you only get results from the first 500 records, as delegation with CDM should work.  In any case CDM will change in the next few days (see this announcement) so things may change in that front.

Please let me know if this has worked or if you need more details or clarifications.

Regards,

Giacomo

kruismanp
Level: Powered On

Re: Get Records that have current user in Column

Thanks. It did work.. As workaround made a first screen to retrieve the email in a txtbox, and a button to navigate to the screen that has the results of the filtered datasource . 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 154 members 5,263 guests
Please welcome our newest community members: