web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Suggested answer

How to search emails in Get emails (V3) ?

(0) ShareShare
ReportReport
Posted on by 12,865

Hello people.

 

What's the proper syntax of search query in "Get emails (V3) "?

 

I need to select only NDR messages from Inbox and this string in the field "Search Query" just doesn't work:

 

MessageClass:REPORT.IPM.Note.NDR

 

Note that the same filter works fine in Outlook.

 

 

I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at
    Re: How to search emails in Get emails (V3) ?

    Hi @VictorIvanidze 

     

    Get emails V3; the filter is the same as Outlook. Strangely, it doesn't work.

    2020-02-05 15_17_11-Create your flow _ Power Automate.png

     

     

    Can you please share the error so that we can validate it?

     

     

  • VictorIvanidze Profile Picture
    12,865 on at
    Re: How to search emails in Get emails (V3) ?

    No errors - it just returns nothing.

    Could you please try to search NDR's in your Inbox?

  • manuelstgomes Profile Picture
    6,625 on at
    Re: How to search emails in Get emails (V3) ?

    Hi @VictorIvanidze 

     

    Indeed it's strange. I get results on my Outlook and no results running the Power Automate.

     

    Probably someone else can chime-in, or it's probably a bug that needs to be solved.

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    ​
    Cheers
    Manuel

  • VictorIvanidze Profile Picture
    12,865 on at
    Re: How to search emails in Get emails (V3) ?

    Well it looks like a bug. Can somebody confirm?

  • Community member Profile Picture
    on at
    Re: How to search emails in Get emails (V3) ?

    The description of the field is clearly inaccurate and needs to be fixed.

     

    This field maps to "$search" parameter - and this is documented in detail here: https://docs.microsoft.com/en-us/graph/query-parameters#search-parameter

     

    I couldn't figure out a way to search for only NDR though - and the documentation above doesn't show that it supports searching on MessageClass.

  • Community Power Platform Member Profile Picture
    on at
    Re: How to search emails in Get emails (V3) ?

    Hi @SameerCh ,

     

    I am trying  subject:"@{items('Apply_to_each')?['WorkloadDisplayName']} : @{items('Apply_to_each')?['Status']} : @{formatDateTime(items('Apply_to_each_2').PublishedTime,'dd/MM/yyyy:HH:mm')}"

     

    It is throwing an error as "Syntax error: character ':' is not valid at position 26

     

    Please help

  • Community member Profile Picture
    on at
    Re: How to search emails in Get emails (V3) ?

    Hi @Anonymous 

     

    Not sure where the error is coming from. One way to isolate the issue would be to see if the formula is correct first.  To do that, you can perhaps try using the "Compose" action separately.  It will tell you exactly how the expression is evaluated.

     

    Then, you can pass the result in the Search parameter of your Get emails action.

     

    HTH

     

  • i_power Profile Picture
    76 on at
    Re: How to search emails in Get emails (V3) ?

    I had the same problem. Turned out to be the double quotes ".

     

    Changed to single quotes ' and then it worked.

  • jmbo Profile Picture
    6 on at
    Re: How to search emails in Get emails (V3) ?

    Yes, I confirm that I get no errors - it just returns nothing

  • Suggested answer
    andy-clapham Profile Picture
    25 on at
    How to search emails in Get emails (V3) ?
    This is an old post but I seem to have worked out the "quirks" of the get emails v3 search box.
    Looks like the developer forgot to escape the search parameter properly, instead they just added "s either side.
    So you have to do quote escaping and url character encoding it yourself, as per https://learn.microsoft.com/en-us/graph/search-query-parameter?tabs=http
     
    More details here:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 650 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 341 Moderator

#3
developerAJ Profile Picture

developerAJ 256

Last 30 days Overall leaderboard