Unable to apply filter to retrieve CC and BCC mails from particular sender using O365 get mail activity

How to use Office365 get mail activity to retrieve CC and BCC emails. With the help of the query contains(from/emailAddress/address,‘myMailId’), I was able to retrieve emails from the specified mail id. But I am unable to retrieve if the mail ID is in CC or BCC. I have tried a number of other CC queries, but I am unable to accomplish that. Someone please assist me with this.

You probably want to do “contains(from,‘MyMailId’) or contains(cc,‘MyMailId’) or contains(bcc,‘MyMailId’)”

Thank you for your reply. I have tried it, but it returns the error message - Get Mail: Invalid Query. Please use OData format for filter queries. Press F1 for examples.

Post your full query from the get mail activity

I previously used the query “contains(from/emailAddress/address,‘myMailId’)” to retrieve emails from a specific mail ID. However, with that query, emails were not retrieving if the specific mail ID was in the CC or BCC.

I meant show me the query as you entered it for my suggestion with OR.

As for your query, did you try…

contains(from/emailAddress/address,‘myMailId’) or contains(cc,‘MyMailId’) or contains(bcc,‘MyMailId’)

Maybe it would be…

contains(from/emailAddress/address,‘myMailId’) or contains(cc/emailAddress/address,‘MyMailId’) or contains(bcc/emailAddress/address,‘MyMailId’)

This is the query I am providing.
The error message that it displays is this.
MicrosoftTeams-image (1)

As I said, maybe it needs to be…

contains(from/emailAddress/address,‘MyMailId’) or contains(cc/emailAddress/address,‘MyMailId’) or contains(bcc/emailAddress/address,‘MyMailId’)

I have given the query as you said

I am currently receiving this error message.
MicrosoftTeams-image (2)

Additionally, I have used “ccRecipients/any(a:a/emailAddress/address eq ‘EmailID’)”.
However, when I use this query, the following error message appears:
Get Mail: Code: ErrorInvalidUrlQueryFilter
Message: The query filter contains one or more invalid nodes.
ClientRequestId: 24d01d84-f99f-4271-a39a-ee1453c41517

What is the resulting query when you run it, such that in_host is replaced? Use a Log Message to output the query so we can see the result.

The argument I am using is in_host. That argument’s value is adarsh.ar@gmail.com

What I’m saying is use a Log Message before the Get Mail, and paste your query expression in there so we can see the final result actual query it’s using.

The query has been printed as a log message. This is how it seemed.
MicrosoftTeams-image (5)

You know, now that I think about it, there probably won’t be any bcc data. That’s why it’s blind carbon copy. It doesn’t tell you who it was BCC’d to. Try it with just from and cc.

I removed the bcc filter, but the error persisted.
MicrosoftTeams-image (6)

I wonder if it would be something like to/cc/Address

You can’t filter based on those properties because they don’t support filtering, you can use them in a search Use the $search query parameter in Microsoft Graph - Microsoft Graph | Microsoft Learn