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 specific in...
Power Automate
Answered

Extracting specific information from the body of the email to MS excel

(1) ShareShare
ReportReport
Posted on by 37

Hello,

 

I'm stuck with this task of extracting specific information from the body of the email (Attached) to MS excel. From the long email that is generated everytime a ticket is booked with the agency, I want to extract just the employee ID, flight #, booking ID, and the destination and arrival city and country of each leg in an excel file

 

I tried using different expressions to get these specific info from the email but couldn't get the required info to MS Excel. 

 

split(outputs('Html_to_text')[4],':')[1]
first(skip(split(body('Html_to_text'),'Flight: '),1))
first(skip(split(body('Html_to_text'),'Flight: '),4))

 

Any help would be much appreciated.

 

Regards,

Raam

Categories:
I have the same question (0)
  • trice602 Profile Picture
    16,071 Super User 2026 Season 1 on at

    Hi @power13 ,

     

    I just helped someone yesterday do this and providing the link to that thread.  Please mark as a solution and follow the steps.

     

    Solved: Re: Extracting Specific Text from an Email Body - Power Platform Community (microsoft.com)

     

     

  • Verified answer
    trice602 Profile Picture
    16,071 Super User 2026 Season 1 on at

    Hi @power13 ,

     

    I forgot to mention, once you have the individual variables of the email data you want, then you 'Add a row' Action and use those dynamic variables to add to your Excel workbook.

     

     

  • power13 Profile Picture
    37 on at

    Thank you @trice602 !! It worked well as expected. However, I have a challenge here. My travel itinerary may have two or three country of origin and departure date and I want to fetch each occurrence as a row and have it stop when there is no further data. 

     

    For example, from the attached email text, I want my output to show the information in the table below. The fields repeat with value changing and I want each one to show in a separate row in Excel. So grateful if you could resolve this one.

     

    Emp IDFlightOriginDeparture date DestinationArrival date
    999999Qatar AirwaysBangkok, Bangkok Suvarnabhumi International Apt (BKK)Thursday 28 September 2023 at 8:00PMDoha, Doha (DOH)Thursday 28 September 2023 at 10:50PM
    999999United AirlinesDoha, Doha (DOH)Friday 29 September 2023 at 1:20AMWashington, DC, Washington Dulles International Apt (IAD)Friday 29 September 2023 at 8:50AM
    999999Air FranceWashington, DC, Washington Dulles International Apt (IAD)Friday 29 September 2023 at 1:20AMParis Charles de Gaulle Airport (CDG)

    Friday 6 October 2023 at 8:50AM

     

     

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 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard