Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Triggers
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
  • Get help with 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!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

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.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes