The Right Way to Filter SharePoint Person Column in Power Automate - Best Techniques

Power Automate Filter Query With Person Column From SharePoint Online

No comments

Loading

In this โ€œPower Automate Filter Query With Person Columnโ€ article, we will learn what the best way is to filter Person Column Email ID from SharePoint Online List while querying the list items using the Power Automate Get Items action. Here, I have used the โ€œGet My Profile V2โ€ and โ€œGet Itemsโ€ actions. Already, I have written an article on how to work with the โ€œGet Itemsโ€ action in Power Automate flow. Now, before I dive into more on this, I will a little bit explain about the โ€œGet My Profile V2โ€ action.

Power Automate Filter Query With Person Column From SharePoint Online

Before I take you to the flow action, letโ€™s have a fair understanding of the โ€œGet My Profileโ€ action.

What is โ€œGet my profile (V2)โ€ action in Power Automate?

The โ€œGet My Profile (V2)โ€ action in Power Automate is used to retrieve the profile information of the user who is currently executing the flow. This action comes from the Microsoft Graph API and is part of the Office 365 Users connector. It allows you to get detailed information about the user, such as:

  • Full name
  • Email address
  • Job title
  • Phone numbers
  • Department
  • Manager
  • Office location

Key Use Cases:

  1. Personalized Workflows: Automate tasks based on the userโ€™s identity, such as sending personalized emails or filtering data relevant to the logged-in user.
  2. Approval Workflows: Retrieve user details for approval processes or routing tasks based on department, manager, or job title.
  3. Dynamic User Information: Use the profile data dynamically in workflows for reports, task assignments, or documentation.

This action is especially useful when you need to identify or work with the user running the flow without having to manually input their details.

Get Person column email ID Using Power Automate Flow

Step 1: Person column in SharePoint Online list.

This is the employee name person column in my SharePoint Online list.

Person Column in SharePoint Online list
Person Column in SharePoint Online list

If we query the above list using the Power Automate โ€œGet Itemsโ€ action, we will get the below output where we can see that the โ€œEmailโ€ is the property to extract an employeeโ€™s email from the Employee Name column.

Power Automate Get Items Output
Power Automate Get Items Output

But if we pass the same thing in the โ€œGet Itemsโ€ filter query, it does not work. Weโ€™ll get the following error:

โ€œOne or more field types are not installed properly. Go to the list settings page to delete these fields.
clientRequestId: 054de44e-3e8b-4506-8f69-d090da4c3a71
serviceRequestId: bf9757a1-d016-6000-97f1-1333f317434bโ€

Flow run failed in Power Automate
Flow run failed in Power Automate

Then, if we see the output of โ€œGet my profile (V2),โ€ย  there we can see โ€œmailโ€ is the property to extract email id from my profile action, but if we pass the same to the โ€œGet Itemsโ€ filter query, this also does not work and gives the same above errors. So, these errors are not true.

Power Automate Get my profile v2 Output
Power Automate Get my profile v2 Output

What is the right query to filter the person column based on the email ID?

Below is the right query to filter the SharePoint Online Person column based on the logged-in user email ID.

Power Automate Filter Query With Person Column From SharePoint Online
Power Automate Filter Query With Person Column From SharePoint Online

In the above query, โ€œEmployeeNameโ€ is the person type column in my SharePoint Online list.

Notice that in the above โ€œEMail,โ€ย  โ€œMโ€ is in capital letters. I still donโ€™t know what the capital letter โ€œMโ€ is doing here; if we pass this in lowercase โ€œm,โ€ย  this query does not work and gives a bad request error.

The technique I am sharing here, I didnโ€™t get from Google or any forums; this is completely from my personal experiences and research.

Letโ€™s run this flow; this time it will run successfully.

Flow ran successfully in Power Automate
Flow ran successfully in Power Automate

Summary

Thus, in this blog, we have learnt how to filter SharePoint Online list items based on the logged-in user email ID using Power Automate โ€œGet my profile V2โ€ and โ€œGet Itemsโ€ actions dynamically. This technique you can use in your flow to get logged user profile details from the SharePoint Employee Management list or any other list.

And also, we have learnt how to fix the error โ€ One or more field types are not installed properly. Go to the list settings page to delete these fieldsโ€.

ย 

About Post Author


Discover more from Global SharePoint

Subscribe to get the latest posts sent to your email.

Do you have a better solution or question on this topic? Please leave a comment