Get Mail Activity of MS365: want to filter the mails with To criteria

We want to filter mails using MS365 Get Mail Activity Query property.

to filter for sender address we put: from/emailAddress/address
to filter with Mail To what should be used?

I’ve come across one thing in Microsoft graph link but don’t know how to use it?
Thank u so much in advance.
Urgent request


“from”:{
“emailAddress”:{
“name”:“Adele Vance”,
address":"adelev@contoso.com
}
},
“toRecipients”:[
{
“emailAddress”:{
“name”:“Alex Wilber”,
address":"AlexW@contoso.com
}
}
],

Link: Get message - Microsoft Graph v1.0 | Microsoft Learn

toRecipients is holding an array so it is the collection
e.g. Any Operator can be used to filter on a recipient, contained within the Mail-to list

can u please help with how it can be put in Query property of Get MAil?

I got this one with ChatGPT but it isn’t working:
toRecipients/any(r:r/emailAddress/address eq ‘AlexW@contoso.com’)

Hi @anjasing

To filter emails where the recipient is abc@company.com, you should use the following property in the Get Mail Activity Query properties section:

toRecipients/emailAddress/address eq ‘abc@company.com’

it might be worth to crosscheck the used details as on some levels the toRecipients Property was treated as nonfilterable property.

In such cases it can be checked if the search syntax can help:

used it already, but ain’t working

Please share the error screenshot, Might be we can help better.
Thanks @anjasing

we also recommend to checked out the newer|st package version where the activity is renamed to: Get email List and is offering a filter builder

We can’t use these activities. We are using Microsoft Classic 365 activities - Get Mail.
As Get Email list requires connections to be established.

Get Mail : Code: BadRequest
Message: Invalid filter clause: The parent value for a property access of a property ‘emailAddress’ is not a single value. Property access can only be applied to a single value.
Inner error:
AdditionalData:
date: 2025-03-27T14:05:27
request-id: **
client-request-id: **
ClientRequestId:**

updated the error. This is the error which is coming

I’ve tried this as well for e.g. putting directly this "to:AlexW@contoso.com
" in Query property but still not working

kindly note:

as mentioned:

Yes, that I understood. But what needs to be used now? Please guide

Tried this as well:
“$search=‘recipients:abc@abc.com’”
not working!!

@anjasing

Can you pls try:
toRecipients/any(r:r/emailAddress/address eq ‘abc@abc.com’)

I’ve already tried it. It isn’t working, if u can refer to my above post @prashant1603765

Hi @anjasing, I’m having the same issue. Did you find a solution?