Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

How to search in the email text using Power Automate flow

Posted on September 18, 2022September 18, 2022 by Tom

“I’d like to get all emails with a specific topic keyword, can I use Power Automate to search in the email text?”


When you need to get emails from a mailbox, the ‘Get emails’ action gives you a lot of options. You can filter by the subject, sender, recipient, CC, etc., but what about the email text? There’s no field that would explicitly ask you for a keyword. How do you search in the email body then?

Use HTTP request instead of ‘Get emails’

The first thing I’d recommend is to not use the ‘Get emails’ action. That action will return maximum 25 emails, no matter how many there’re. Since there can be more than 25 emails it’s better to use the Office 365 Groups action ‘Send an HTTP request’ without such limitation.

Once you add the action you can easily define the filter directly in the url. For example, if I want to search for all emails with the word ‘nordic’ in the body, I can just add the parameters &search=”body:nordic”.

https://graph.microsoft.com/v1.0/me/mailFolders('Inbox')/messages?$select=sender,subject,body&top=100&search="body:nordic"
Power Automate search email text

To decompose the search parameter into pieces:

&       - adding another parameter in the url
search  - to search for something
=       - what to search for?
body    - search where
:       - search for
nordic  - the actual value to search for

Put it all together and it’ll return only emails with the word ‘nordic’ in the text.

Note: you can also search in from, subject, and body at the same time if you skip the ‘search where/for’ in the url, e.g. &search=”nordic”.

Summary

As you can see, you can quite easily search in the email text using Power Automate flow. Instead of the default action use an HTTP request and add the parameter to the url. It’ll return more than 25 emails and you can even search in from, subject, and body at the same time.

And it’s not limited to email body, there’s a whole bunch of values you can search for as specified in the Microsoft documentation.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

  • How to find Excel rows missing in SharePoint list (Power Automate)March 29, 2023
  • Check whether user exists in AAD with Power AutomateMarch 26, 2023
  • How to highlight whole SharePoint row based on calculated dateMarch 22, 2023
  • Why is your Power Automate flow running so slow?March 19, 2023
  • How to add multiple links to the Power Automate approval taskMarch 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes