Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Check if email already exists in Outlook contacts (Power Automate)

Posted on August 7, 2022August 7, 2022 by Tom

“I’d like to automatically create a contact in Outlook contacts from an incoming email but it’s creating duplicates, how can I check if such contact already exists in Power Automate flow?”


One of the biggest benefits of Power Automate is the integration with the other M365 tools, e.g. Outlook. You receive an email with a specific subject, and additionally to some automated processing you can also add the sender to your contacts list. But you don’t want to create a new contact for each email from a sender. The contact should be created only with the first email, meaning you should always check if the contact already exists.

How do you do that in Power Automate flow, how to find a contact by an email address?

Search for a contact

The ‘Get contacts’ action offers you similar Filter Query possibilities as the SharePoint ‘Get items’ action. You define the property, operator, and the value to search for. For example, to look for a contact using the contact name and surname.

Note: you can see all the available columns if you run the action without any filter and then check the output.

Such Filter Query will work for all the simple columns, but it won’t work for the email address. The problem is that email addresses are always an array of objects with the emails inside.

Power Automate Outlook contacts email exists

Use the ‘any’ operator

In these situations you must use the ‘any’ operator in the OData Filter Query. The syntax in Power Automate is as below.

Search in the emailAddresses…

emailAddresses

… in any of the objects …

emailAddresses/any

… where the object property address …

emailAddresses/any(a:a/address

… equals to a specific email address.

emailAddresses/any(a:a/address eq 'dev@tomriha.com')

All that’s left is to check if the action found any contacts. If there’s no contact with such email address, create it. Otherwise do nothing, the contact already exists.

Power Automate Outlook contacts email exists

Summary

You can use Power Automate to check if somebody with an email address already exists in your Outlook contacts, but you’ll need a bit more advanced Filter Query. Due to the structure of Outlook contacts you can’t just compare two values, you’ll need the ‘any’ operator in the Filter Query to get to the emails. After that it’s just the standard condition if anything was found.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with 1000s of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes