web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extracting Text from e...
Power Automate
Answered

Extracting Text from email without knowing its length?

(0) ShareShare
ReportReport
Posted on by 638

Greetings!!!

 

Many thanks to all those that post up questions and answers, just by searching this board I have been able to find a ton of solutions and inspirations!!

I found a great thread that has helped me create a flow to extract some text values from an email.

My Flow first converts the email to plain text using "HTML to text"

 

For example my incoming email contains;

 

Ticket ID# 8371     

 

The function I'm using in Flow is

substring(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),'Ticket ID#'), 11),7)

 

The return is

8371

 

Later that chunk of text gets put in to a column in and Excel sheet hosted on Sharepoint.

OK, so all is well so far and I'm using the same function for other bites of data and I just modify my label along with the character counts.

 

My Challenge;

Its real easy for terms like Ticket ID, or Location cause I know what the max value will be.

I'm jammed on how to deal with other bites of data that could be only 10 characters in length, or it could also reach 500.

 

For example 

Ticket ID# cause in some of my fields it could just be a simple 4-6 letter or someone could type out something much longer

 

I'm super n00b at using these expressions, but hoping someone could give me an example to work with.

I have full control of the incoming email, so my first instinct is that it would be great to somehow identify an opening and a closing "gate/bracket/iD"--- not sure what to call it, but basically a means to book end my data bites.

 

something like just capture the text you see in between; 

 Ticket ID#<start> 8371 <end> 

 

hope this all makes sense!!

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @chico,

     

    If possible, please consider using Parser to turn incoming emails into useful data then use the returned values in your next actions.

    Please check this blog for more deteails:

    https://parserr.com/blog/email-parser-for-microsoft-flow/

     

     

    Best regards,

    Mabel Mao

  • chico Profile Picture
    638 on at

    yeah Parser and other services are cool but I'm not allowed to send emails outside of our internal network to a third party.

    Plus, it would just be an extra cost and we have no money.....

  • Verified answer
    chico Profile Picture
    638 on at

    guess I'm not the only one looking for this...

     

    https://powerusers.microsoft.com/t5/Building-Flows/Extract-text-from-URL-of-an-RSS-Feed-Body-in-Flow/m-p/68436

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 612

#2
Valantis Profile Picture

Valantis 344

#3
11manish Profile Picture

11manish 326

Last 30 days Overall leaderboard