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?
Solved! Go to Solution.
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
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
Thank you...worked like a charm!
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
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
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 .
User | Count |
---|---|
142 | |
142 | |
77 | |
74 | |
71 |
User | Count |
---|---|
232 | |
166 | |
75 | |
67 | |
61 |