Not able to use filter query parameter for filtering based on from address of user using 'in' or 'eq'

Anumalasetti, Naveen 0 Reputation points
2023-06-06T07:20:40.4766667+00:00

HI Team,

I have been working on a use case which includes to filter mail based on the from address i.e senders email. I am trying to achieve this using Mulesoft outlook 365 connector where I need to give filter query parameter.

I have tried using 'in' with filter query data parameter but getting error for 'in' saying "The query filter contains one or more invalid nodes.". The format I am using is as follows:-

Format :- from/emailAddress/address in ('******@abbvie.com','******@def.com')

please suggest a solution using 'in' or any other filter that reduce the burden of writing multiple conditional statements if we have more emails.

Microsoft Security Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,371 Reputation points
    2023-06-06T07:44:48.54+00:00

    Hi @Anumalasetti, Naveen

    You should filter with single quotes (' ').

    To filter based on individual senders:

    https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq '******@abbvie.com'
    

    To filter based on multiple senders:

    https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq '******@abbvie.com' or from/emailAddress/address eq '******@def.com'
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.