cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

How to parse email body as a condition in MS flow

Hi,

 

In my email body, I want to build a flow with a condition to look for email body with this string

 

<span style=\\"background:red\\">Fail</span>

 

So I tried but it does not work.  Can you please tell me what am I missing?

@or(contains(triggerBody()?['Body'], '<span style=\\"background:red\\">Fail</span>'), contains(triggerBody()?['Body'], '"background:red\\'))

 

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: How to parse email body as a condition in MS flow

Hi @scheu,

 

Please try to add an action Convert HTML to text before the Condition.

I have made the following test and it just works fine.

The condition is configured likes below:

@or(contains(body('Html_to_text'), '<span style=\\"background:red\\">Fail</span>'),contains(body('Html_to_text'),'background:red\\'))

Image for your reference.

1.PNG

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
New Member

Re: How to parse email body as a condition in MS flow

Hi @scheu

Not sure if you have considered using https://parserr.com ? Its called Parserr in the connector list

Helps to do this without code and also extracts from PDF, CSV and Excel

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (7,977)