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!

 

Comments

4 comments on “Using Microsoft Flow Get Items Action and Filter by E-mail address of a Person Field”
  1. kiyoshi suzuki says:

    γ™γ”γ„γ€‚γ“γ‚Œγ‚’ζŽ’γ—γ¦γ„γŸγ€‚γ‚γ‚ŠγŒγ¨γ†γ€‚

  2. Jonathan Robinson says:

    Thank you! This was exactly what I was looking for and the implementation entirely solved what we needed, so much appreciated!
    One quick question: for the filter query where [SP column name]/EMail eq ‘whatever’ – how did you know that both the E and M of EMail needed to be capitalized to make the flow work? I initially tried my flow with /email and /Email and neither worked until I made it /EMail and then magically it all went through? What’s the precedence for this and how do I find out what I need to use to make the other components of the person array work correctly?

    1. Jared Matfess says:

      Hey Jonathan – glad it worked for you. The trick that I do is start with a get items action and then go run the Flow and click on that particular run to inspect what was returned from the GET. When you expand the result you can see the internal column names, etc. It’s really hard to guess what SharePoint is going to call things so to keep it easy, I just check to see what the Get Items / Get Item returns. No magic. πŸ™‚

  3. Jonathan Robinson says:

    Thanks for the response. The odd part is that when I looked at the details of the Get Items, the person sub-field name showed up as Email (vs EMail). No big deal I suppose so long as I was able to find this info on your post. So again, thank you!

Leave a Reply