Jared Matfess's Blog

Having fun with SharePoint, Office 365, and Microsoft Azure

Using Microsoft Flow Get Items Action and Filter by E-mail address of a Person Field — July 14, 2018

Using Microsoft Flow Get Items Action and Filter by E-mail address of a Person Field

This blog post is going to win an award for best title ever. 🙂

A colleague and I were working on a problem where we wanted to aggregate all the list items that were assigned to a particular person, and then send them an aggregated e-mail in a simple HTML table. Sounds easy enough right?

To get started – let’s create a simple list with Title, Owner (Person), and DueDate (Date/Time) columns like below:

List1-Items-Users-DueDate.jpg

Next, we’re going to create our Flow from a Blank Template and have the Trigger be Flow Button for mobile – essentially manual for testing purposes. Next, add the “Get items” action and enter your site address & list name:”

InitialFlow

Before we add the filter to Get items, I recommend you save and test the flow so that you can see what gets returned from SharePoint before you apply your filter.

What gets returned is in the Body section of the Get items outputs:

FlowOutputsBody

Looking at what’s returned you’ll see that the Owner column has properties such as Claims, DisplayName, and Email.

Now, let’s go ahead and add the filter so that we’ll return List items that have tim@matfess.onmicrosoft.com as the Owner.

Show advanced options to show the Filter Query input

FlowAdvanced

Now let’s add the filter and notice the case sensitivity. You’ll want to reference the e-mail attribute as ColumnName/EMail so for my example it’s Owner/EMail

FlowFilter.jpg

Now try running your Flow and you should see success!

Status200Flow.jpg

The output of the Get Items is now a collection of all the Items returned based on your filter. Now you can loop through the results and take the appropriate action based on your use case.

Happy Flowing!