cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
chrisingham
Level: Powered On

Issue finding text in email body

Hello,

 

I'm trying to use Flow to extrac some information from an email body but I'm encountering a very unusual problem when trying to extract part of a title between two placeholders;

 

1) I convert the body of the email to text using the HTML to Text conversion

2) I look for the first placeholder text before the text I want to extract using;

        a) add(indexof(body('Html_to_text'),'Short Description = '),20) - The 20 gives me the end character of the string rather than                  start
3) I look for the placeholder text at the end of the text I want to extract using;
       b) indexOf(body('Html_to_text'),'Customer')
4) I then look for the text between the two placeholders using;
      c) substring(body('Html_to_text'),variables('TitleStart'),variables('TitleEnd'))
 
The issue is, the start character formula returns 232 which correctly gives me the start of the title I want to search for, the end character formula returns 271 which gives a 39 character long string in the middle which is correct, however the output of the last function which should give a string between characters 232 and 271 (39 chars) actually gives a string that is 262 characters long. I can't understand why this is, as the function simply asks for a substring of the email body from chars 232 to 271. The start position of the text string is correct, but the string goes on too long and doesn't stop. 
 
Has anyone encountered this problem before? Does anyone know how to resolve this? I've manipulated text many times in flow and never encountered this problem before
 
Thanks
Chris
 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
chrisingham
Level: Powered On

Re: Issue finding text in email body

Sorry! I just realised the problem, the substring function asks for a length at the end, not the end character number. I can't figure out how to delete this question now!

 

View solution in original post

2 REPLIES 2
chrisingham
Level: Powered On

Re: Issue finding text in email body

Sorry! I just realised the problem, the substring function asks for a length at the end, not the end character number. I can't figure out how to delete this question now!

 

View solution in original post

DeepakS
Level 8

Re: Issue finding text in email body

@chrisingham  Just mark it  completed 🙂 

 

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

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (3,847)