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

Notifications

Announcements

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
    15,404 Super User 2025 Season 2 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
    15,404 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard