Caleb McDonnell
Caleb McDonnell

Reputation: 11

How do I $filter outlook messages based on values stored in data Extensions?

I've just started using MSGraph, and I'm storing some custom data in Graph resources using the Open Extension option. Now I want to get a list of those resources where the Extension contains custom property values (e.g. DealValue = 50050).

I've tried the following query in the Graph Explorer to get a list of messages:

https://graph.microsoft.com/v1.0/me/messages/
?$filter=Extensions/any(f:f/id eq 'testExtension' && f:f/DealValue eq '500050' )
&$expand=Extensions($filter=id eq 'testExtension')

I was hoping for list of message items that had a DealValue of 50050, but I get the following response:


{
    "error": {
        "code": "BadRequest",
        "message": "Invalid filter clause",
        "innerError": {
            "request-id": "...",
            "date": "2019-04-10T23:30:50"
        }
    }
}

2 Questions:

  1. Is it possible to $filter on embedded properties with Extensions?

  2. If not, what are my other options?

Any help would be greatly appreciated.

Thanks!

Upvotes: 0

Views: 181

Answers (1)

Caleb McDonnell
Caleb McDonnell

Reputation: 11

For anyone else visiting this question, I finally found the answer:

At the time of writing:

  1. No, it is not possible to filter on custom properties in Open Extensions.
  2. Use Schema Extensions if you need to filter on custom properties

Upvotes: 1

Related Questions