cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Continued Contributor
Continued Contributor

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!

4 REPLIES 4
Highlighted
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.

Highlighted
Continued Contributor
Continued Contributor

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"
    }
  }
}

 

 

 

Highlighted
Frequent Visitor

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

according to some recent flow documentation I found it should be 

 

emailAddresses/address eq 'some@someother.com'

 

but that fails as well with invalid filter clause.

 

As a workaround I store the email address also on a top level field. But of course that is not how it should be.

 

If anyone knows how to solve this, please help.

 

Thx

Highlighted
Continued Contributor
Continued Contributor

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

This is an old post of mine. if memory serves me well, I later learned that the Filter query here does NOT use ODATA syntax. it uses the userland search logic, like when you do a plain search on Outlook Web's search box. 

 

That on one hand is intuitive for certain actions. but for tech heads it is limiting. 

One cannot search for messageId or internetMessageID, two extremely useful properties to track emails. 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (7,388)