cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Condition body contains with spaces

Hi, 

 

I would like to use the Condition Control action to search for strings in the body of an email.  I'm using Condition search in Body of message and Contains.  I can get it to work just fine with one word or any string with no spaces, but as soon as I try to find a string with spaces such as "total of 1 events" which does exist in the email, the flow doesn't work/match because it can't find that string.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Condition body contains with spaces

Hi @maharaiPi ,

 

If so, please use the HTML to text action convert the HTML code into text firstly, for example:

Annotation 2020-07-10 165525.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
Highlighted
Community Support
Community Support

Re: Condition body contains with spaces

Hi @maharaiPi,

 

I tested it on my side but it works well, could you please share your Flow configuration?

Annotation 2020-07-02 152147.jpg

 

Annotation 2020-07-02 152200.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Regular Visitor

Re: Condition body contains with spaces

sure, it says i cant upload image so here's a link to a pic.  That Condition block will result in True if I remove the last contains search for 'total of 1 events', but it should still result in True because the Body of the email I'm testing with does contain that phrase/string

https://send.firefox.com/download/38492082ce52192b/#tALqIdNypDaVfD_BvrcXEQ

 

 

 

Highlighted
Community Support
Community Support

Re: Condition body contains with spaces

Hi @maharaiPi,

 

Have you check is there any blank space at the end of the string? (Red line marked)

InkedAnnotation 2020-07-02 095126_LI.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Regular Visitor

Re: Condition body contains with spaces

in the string I use there are no starting or trailing spaces, so it's looking for exactly like this "total of 1 events"

 

 

Highlighted
Community Support
Community Support

Re: Condition body contains with spaces

Hi @maharaiPi,

 

It's weird, I tried to reproduce the same conditions but still not found the same issue:

Would you please have a try that recreates such a condition action? And put a compose action before it to check the content of Email body?

Annotation 2020-07-07 172058.jpg

 

Annotation 2020-07-07 172108.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Regular Visitor

Re: Condition body contains with spaces

I tried what you suggested and the Compose Output looks like this(below and in blue is the target string), I only included a snippet of the full text, hope that's ok.  You can see that there's some formatting involved that is probably causing the phrase search to not match.  Is there something I can do to get around this?

 

 

</style></head><body lang="EN-US" link="blue" vlink="purple"><div class="WordSection1"><p class="MsoNormal">&nbsp;</p><p>Hello Dat Vo,</p><p>Cisco AMP for Endpoints found a total of <strong><span style="font-family:&quot;Calibri&quot;,sans-serif">1</span></strong> events matching your subscription named <strong><span style="font-family:&quot;Calibri&quot;,sans-serif">Cloud IOC</span></strong> since 2020-06-26 14:18:20 UTC. </p><p class="MsoNormal" style="margin-right:7.5pt; margin-bottom:7.5pt; margin-left:43.5pt; text-indent:-.25in; mso-list:l0 level1 lfo1"><span style="mso-list:Ignore">1.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span>&nbsp;</p>

Highlighted
Community Support
Community Support

Re: Condition body contains with spaces

Hi @maharaiPi ,

 

If so, please use the HTML to text action convert the HTML code into text firstly, for example:

Annotation 2020-07-10 165525.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Regular Visitor

Re: Condition body contains with spaces

 

thanks but that didn't help.  A Condition that looks for "1 events" for example came out false, even though I can see in the output that it is indeed plain-text format now with no html in it.

 

a snippet of the Output that is now in plain text is:

"Endpoints found a total of 1 events matching your subscription"

 

I tried doing "1 events" in the field, with the double or single quotes, as well as just the string itself with no luck

Highlighted
Regular Visitor

Re: Condition body contains with spaces

any other ideas?

 

I did try your way of testing with putting a sentence in a Compose Input, see it show up in Output, and a search for a phrase with spaces did match just fine.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Users online (4,289)