Does your Power Automate flow need to filter only items or documents assigned to a specific person and ignore the rest? And the User eq ‘User’ OData Filter Query doesn’t return anything?
The ‘Person or Group’ column contains a user object. It’s not a simple information as ‘user name’ that you can compare, but a collection of user attributes. You’ve got user name, user email, user claims login and more. The OData Filter Query in Power Automate can’t filter on the person object. It can filter only on a specific attribute of the user.
Let’s consider ‘Person or Group’ column called ‘Person’. The column by itself is an object, but you can easily access its attributes. Instead of just Person in the filter, get deeper by selecting an attribute.
Instead of just:
Person eq ...
Use:
Person/EMail eq 'person@company.com'
Person/Title eq 'Firstname Lastname'
My preference is the email attribute, as it’s unique and every user has one. Depending on your needs, you can either hard code the right side value, or use dynamic content.
As with all the other Filter Queries, even this one can save you a lot of empty loops. It’s always better to use a query instead of IF conditions later in the flow.
Does this function work in your environment? I tested it out and it throughs an error saying: “One or more field types are not installed properly. Go to the list settings page to delete these fields.”
Hello Panos,
that’s an error you get when you don’t have upper/lower-case correctly in the query. Do you have it the same way as in the post? For Title (user name) it should be upper case T: /Title, for email it must be upper-case E and M: /EMail.
update: I just noticed I have it wrong on the screenshot, I’ll update it in a moment.
Tom
Very helpful – case sensitivity and properties were bogging me down. thank you
Very cool, is there a way to get it to work with claims.
Person/Claims ?
Hello Brian,
for claims it’s (as nobody would probably guess): Person/Name
Thanks a lot Tom, you saved my day!
{“odata.error”:{“code”:”-1, Microsoft.SharePoint.Client.InvalidClientQueryException”,”message”:{“lang”:”en-US”,”value”:”The expression \”Project Manager/EMail eq ‘Person.Name@Company.com’\” is not valid.”}}}
I can’t see where I went wrong in my syntax, “Project Manager/EMail eq ‘Person.Name@Company.com'”
Any thoughts?
Hello Matthew,
you must use the column internal name: https://tomriha.com/what-is-sharepoint-column-internal-name-and-where-to-find-it/
Hi,
Is there anyway to filter using Job Title of the user? I tried person/JobTitle but it did not work.
Thanks.
Hello Robin,
I don’t think so, I think that you can use only their name or the email address.
Hello,
could you please elaborate why we have to reference
on our column name of a person type the Email as EMail and the FullName as Title? (also the claims as /Name?)
Hello Ioannis,
I think it was the trial and error in this case to find the right properties, I don’t have a deeper explanation.
Internal Names of the fields. If you open you list or library, got to the Settings, and then click on the name of the field, in the URL is will show the internal name. For some “Microsoft” reason they have to obfuscate the data.
Thanks! I was wondering how to get the email value from the filter for a user column and I could match two SP lists based on it.
I cannot make this work. I have used the column internal name and ensured that I had capitals on the E and M in email, but I still get the error…
{The expression “Responder_x0020_Name/EMail eq “randomname@randomemail.ca” is not valid. Creating query failed.
clientRequestId: 820c8f90-634c-4b4f-954c-5903b36fc69b
serviceRequestId: 820c8f90-634c-4b4f-954c-5903b36fc69b}
Has Power Automate changed since you originally made this post? Have I missed something else? Do you have any ideas how I can fix this?
Hello Tammy,
looking on the error message it seems that you forgot the single quotes around the email address.
How can we filter all items that a “multi select” user or group field value? I tried the /Email eq ” but it didn’t work.
Hello Adi,
I’m not sure if you can, maybe you’ll have to list all the rows and filter them later using the ‘Filter array’ action.
Any idea why the ‘ne’ operator wont work on the Author/EMail column?
Hello dag,
not really, I didn’t know that the ‘ne’ doesn’t work but it’s possible that I just never used it.
I was struggling with this and came across your post. You really saved me a lot of time with a simple explanation. THANKS!!!
This answer was harder to find than I thought it would be and than it should be! Thank you so much for this!!
Hi Tom, I’m using this today, ‘Student_x0020_Name eq ‘Email variable from other list’ and it’s not returning any value even when I hard code the email address of the person.
After the Get Items , I’m doing an Append to string variable, and it skips over.
Any thoughts?
Hello Steve,
if the Student_x0020_Name is a people picker you must use Student_x0020_Name/EMail as explained in the article.
Hi. I am trying to only get items, where email from Person is eq to email from Person2 in my sharepoint list.
My filter is
( Person/EMail eq Person2/EMail )
But the error message is:
Fetching items failed. Possible invalid string in filter query.
clientRequestId: dcf70e0a-088a-4a64-8ad2-d9b32392a2d9
serviceRequestId: dcf70e0a-088a-4a64-8ad2-d9b32392a2d9
If I hardcode an email adress
( Person/EMail eq ‘mail@x.com’ )
or
( Person2/EMail eq ‘mail@x.com’ )
then it works. But that is not helping me.
Any suggestions to fix the problem?
Hello Mathias,
you can’t compare two columns in a list inside ‘Get items’ action, try getting all the items and filter them later using the ‘Filter array’ action which gives you more options.
Hi Tom,
Thanks for your post, i want to filter out records where person column (multi select allowed) is empty. Is it possible to do that using Get Items Filter Query?
Hello Santosh,
I think that’s one of the cases where you need the Filter Array action as the ‘Get items’ have problems filtering items by empty value.