cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TiagoFreire Kudo Collector
Kudo Collector

Outlook 365 Connector: ODATA query: filter Contacts by email address

Hi,

 

I am trying to find out whether a Contact with a specified email address already exists, but I am having trouble figuring out the exact syntax. 

 

My difficulty relies on the fact that the Contact has a collection of email addresses, not a single one, so I am not sure hw to filter a sub-property, and I would not like to fetch the whole Contact set and iterate one by one, it would not be efficient.

 

I have been tryint to bang the 'in' comparison operator. like this: 

 

 'someemail@addr.ess' in emailAddresses.Address

 'someemail@addr.ess' in emailAddresses/Address

 

But I am getting an invalid filter clause error. 

I am assuming that the 'in' operator would be able to look each item from the collection and return true on a match. Maybe I misunderstood the ODATA documentation? 

 

Any help is appreciated, thanks!

2 REPLIES 2
Community Support
Community Support

Re: Outlook 365 Connector: ODATA query: filter Contacts by email address

Hi @TiagoFreire ,

 

Could you please share a screenshot of the configuration of your flow?

Please share more details about your flow and explain more details about your requirement and we could try to provide a proper workaround for you.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

TiagoFreire Kudo Collector
Kudo Collector

Re: Outlook 365 Connector: ODATA query: filter Contacts by email address

Here is the context: 

 

PROBLEM TO SOLVE:

1) parse all email addresses in the From: and CC: fields

2) check if a Contact already exists for each

3) if there is No Contact, create a contact.

 

What is working:

A PowerApps button sends in a text string - it's actually a JSON which I then parse into several parameters. 

One of those Parameters is a Message_ID for a specific email in a specific Outlook 365 account. 

I can fetch the message from the specified email account. 

 

What is not working: 

I want to use Get Contacts (V2) to fetch a collection of Contacts which have a specified email as one of its addresses, using a Filter Query.

The Filter Query will avoid having to do an exhaustive loop over every Contact, which is very time-consuming, and does not scale well. 

 

outlook 365 connector filter flow.png

invalid filter clause.png

 

The Body of the Output Error is: 

{
  "error": {
    "code": "BadRequest",
    "message": "Invalid filter clause",
    "innerError": {
      "request-id": "some-uuid-very-long",
      "date": "2019-08-02T20:15:29"
    }
  }
}

 

 

 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,604)