Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Extract number from email text

I have a condition in Flow which sends an email depending on a number in the incoming email.


Condition "contains" is passing through without finding the number?



Community Support Team
Community Support Team

Re: Extract number from email text

Hi @tpitman,


Could you please share a full screenshot of your flow's configuration?

Could you share an sample of the incoming email that you mentioned?


I think there is something wrong with the formula within your Condition box. I assume that the body of the incoming email as below:6.JPGPlease take a try with the following workaround:

  • Add a "When a new email arrives" trigger.
  • Add a "Html to text" action, Content field set to Body dynamic content of the trigger.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
@contains(body('Html_to_text'), '12345')

Note: The number should be wrapped with single quotes as above rather than double quotes. If you use basic mode within Condition box, please click "Edit in advanced mode", then check if the number is wrapped with single quotes.


Image reference:7.JPG

The flow works successfully as below:8.JPG




Best regards,



Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: Extract number from email text

Mant thanks, I shall certainly try it

Helpful resources


Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.


Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.


Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 297 members 5,056 guests
Please welcome our newest community members: