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 / Extract Body Text From...
Power Automate
Answered

Extract Body Text From Email

(0) ShareShare
ReportReport
Posted on by 10

Hi


I am using PowerAutomate to pull Text from a standard email template like below, I have tried splits previously, The problem I'm having is some of the fields such as "Vehicles" Aren't always on the same email line as some fields are multiple lines or single lines.

 

The bold Text is always the same. 

 

Destination: Parnngurr 

Arrival Date:  11/03/2024

Check In Time:  16:00

 

Vehicles: KJ33 1HPI 326  n/a  KJ35 1HZU453 n/a  KJ13 1HHN906 n/a  n/a .n/a .



I'm currently using below variable mentioned in a post here, but I keep getting the The length of substring can't be longer than '251' which is the length of the source string, Regardless of what I change the numbers too. 

 

substring(triggerOutputs()?['body/bodyPreview'],add(indexOf(triggerOutputs()?['body/bodyPreview'],'Departing From: '),14),sub(indexOf(triggerOutputs()?['body/bodyPreview'],'Travelling Via: '),add(indexOf(triggerOutputs()?['body/bodyPreview'], 'Departing From: '),7)))

 

Help is much appreciated. 

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

    Hi @KJLog ,

    Could you please post a screenshot of your complete email body?

    Best Regards,

    Sunshine Gu

     

     

  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @KJLog ,

    I did a test for your reference.

    In my scenario:

    My Outlook Inbox:

    vyetonggumsft_0-1710140873055.png

    My Flow:

    vyetonggumsft_1-1710140949451.png

    vyetonggumsft_2-1710141051575.png

    trim(split(split(outputs('Html_to_text')?['body'],'Vehicles:')[1],'Departing From:')[0])
    trim(split(split(outputs('Html_to_text')?['body'],'Departing From:')[1],'Travelling Via:')[0])
    split(outputs('Html_to_text')?['body'],'Travelling Via:')[1]

    Best Regards,

    Sunshine Gu

     

  • KJLog Profile Picture
    10 on at

    That worked perfectly thankyou very much 🙂

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 671

#3
Haque Profile Picture

Haque 551

Last 30 days Overall leaderboard