cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ck25415
Level 8

Filter using user email address - User().Email

Hello,

 

I am trying to filter results to show user entries made by him. I am comparing the email address of the user who uses the app with a people picker field(with existing data) from a sharepoint list.

 

the expression used is Count: CountRows(Filter(Listdatasource, Reviewer.Email = User(). Email))

Reviewer is the people pciker field in sharepoint list. I do not get any results and i recieve the following messageCapture.JPG

 

 

 

 

 

I thoght there is a problem a with datasource and used different a field from the sharepoint list, it worked fine. I cannot delete the reviewer field from the list as it already has tons of data in it.

 

Please help me.

 

Thanks,

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Microsoft Employee

Re: Filter using user email address - User().Email

When you get partial results (before a certain date), how many results in total you're getting? The reason I'm asking is because there's a limitation of 500 items that you can get by default. Above that limitation you may get partial results only. The limitation can be increased to 2000.

Community Support Team
Community Support Team

Re: Filter using user email address - User().Email

Hi @ck25415,

 

Could you please share a screenshot of your app's configuration?

Further, could you please show more details about the expression that you mentioned?

 

I agree with @dinusc's thought almost. The CountRows function could not be delegated by data source, if you add the CountRows function within your formula, your formula could not be delegaed by data source. Your formula would be processed locally, by default, you could only process 500 records within your PowerApps app at most.

 

More details about the Delegation in PowerApps, please check the following article:

Delegation in PowerApps

 

Please check if the amount of partial records (before the certain date) existed in your SP list is more than 500. If the amount of partial records (before the certain date) is more than 500, the rest part records which are created after that date would be ignored. 

 

You could also change the Data row limit for non-delegable queries within the App Settings of your PowerApps app. The maximum value for Data row limit for Non-Delegable queries is 2000.

 

More details about changing Data row limit for non-delegable queries, please check the following article:

Change Date row limit for Non-Delagable queries

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
13 REPLIES 13
Microsoft Employee

Re: Filter using user email address - User().Email

The reason for the warning is because the CountRows is not a delegable function for the Sharepoint connector (see this page for more details).

As for the rest of the formula, please make sure the data Listdatasource.Reviewer.Email matches the data returned by User().Email (you can bind First(Listdatasource.Reviewer).Email to a label or bind Listdatasource.Reviewer to a List box). Please check starting/trailing spaces, casing and etc and possibly apply Lower/Upper or Trim functions.

ck25415
Level 8

Re: Filter using user email address - User().Email

I have tried using Lower function but It did not work. Also, I have hard coded and tested with specific user email address, it shows results only for two user email ids and does not work for any other email address. Below is the expression which gave results for two user email addresses.

 

Count: CountRows(Filter(listdatasource, Lower(Reviewer.Email) = Lower(xyz@abc.com)))

 

 

Microsoft Employee

Re: Filter using user email address - User().Email

I would strongly suggest analyzing the values as the issue may not necessarily be with the letter casing. Please check the email values in your listdatasource.Reviewer.Email field. You shouuld be able to find the reason the match does not work.

ck25415
Level 8

Re: Filter using user email address - User().Email

Reviewer is a people picker field in a sharepoint list. Is there a way to check the email values for this field?

Microsoft Employee

Re: Filter using user email address - User().Email

You should be able to access it as following:

Choices(listdatasource.Reviewer)

You can assign the formula above to a ComboBox control as an eample

ck25415
Level 8

Re: Filter using user email address - User().Email

Thank you. I tried that and it does not show any values in the drop down box. How can I correct this?

Microsoft Employee

Re: Filter using user email address - User().Email

The easiest way would be to assign that formula to a ComboBox control (not DropDown):

After assigning, select the primary text and search field values and then provide a search stirng (type in the searc text area). To sumarize:

ComboBox1.Items=Choices(listdatasource.Reviewer)

ComboBox1.DisplayFields=["Email"]

ComboBox1.SearchFields=["Email"]

Switch to preview

Type something in the ComboBox and open the drop list

ck25415
Level 8

Re: Filter using user email address - User().Email

One intresting thing I have found is the expression is returning results only that are created before a certain date, any results that are created after that date are not being shown. 

 

I have created one more people picker field in the same list and it did no return any results from that field as well.

 

The same expression worked when I created a new list and created a coumn with same name(reviewer) .

 

Any thoughts on that please?

Microsoft Employee

Re: Filter using user email address - User().Email

When you get partial results (before a certain date), how many results in total you're getting? The reason I'm asking is because there's a limitation of 500 items that you can get by default. Above that limitation you may get partial results only. The limitation can be increased to 2000.