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 / Simple question about ...
Power Automate
Answered

Simple question about using expressions

(0) ShareShare
ReportReport
Posted on by 5

I'm completely new and have searched for answers but I feel like I'm a dog groomer trying to get admitted to medical school.  

I'm simply trying to parse out the body of a new email (new leads coming in) and populate it into an Excel sheet.  

 

The email body looks like:

 

Name: Gomer Pyle

 

Email:  xyz dot com

 

Phone: 999-123-4567

 

Comments: Can I get an appointment to hear more about your services!

 

The spreadsheet I've created have those same 4 columns.  I just want to add a row to the spreadsheet.  I'm lost

Categories:
  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @chawk57 

     

    I have made a test for your reference:

    1.

    vliweimsft_1-1675734945827.jpeg

    2.

    vliweimsft_0-1675734934415.png

    Name:

    trim(replace(first(split(replace(outputs('Html_to_text')?['body'],decodeUriComponent('%0A'),''),'Email')),'Name:',''))

    Email:

    trim(first(split(last(split(replace(outputs('Html_to_text')?['body'],decodeUriComponent('%0A'),''),'Email:')),'Phone:')))

    Phone:

    trim(first(split(last(split(replace(outputs('Html_to_text')?['body'],decodeUriComponent('%0A'),''),'Phone:')),'Comments:')))

    Comments:

    trim(last(split(replace(outputs('Html_to_text')?['body'],decodeUriComponent('%0A'),''),'Comments:')))

    3.

    vliweimsft_2-1675735062366.jpeg

     

    Best Regards,

    Levi

     

  • chawk57 Profile Picture
    5 on at

    Thanks you so much.  That got me much further.  However, I failed to tell you that the beginning of the email has an intro section in the body.  It looks like this:

    Below is the result of your feedback form located at:

    {it lists my website URL}

    Sent from: 70.233.162.79

    ======================================================================

     

    Name: Gomer Pyle

     

    Email: xyz dot com

     

    Phone: 9991234567

     

    Comments: Test #7

     

    The email, phone and comments populated my spreadsheet perfectly.  But the Name was populated with all of that introductory information.  So, I believe the Name field is the only one that I need additional help to get that formula correct.

    I suppose it would be good if I also capture the IP Address from the intro section + I would love to format the phone number as (999) 123-4567 but both of those items are low priority.  Thanks again!

     

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

    Hi @chawk57 

     

    For Name, please try:

    trim(first(split(last(split(replace(outputs('Html_to_text')?['body'],decodeUriComponent('%0A'),''),'Name:')),'Email')))

     

    Best Regards,

    Levi

  • TryingToPwrAuto Profile Picture
    13 on at

    This also (partially) worked for my project, thank you!

    This pulls the first result/row perfectly. If my email has sometimes 1 to 100 results on the same email, all ended/seperated by "\n" at the end of the line - how do I "repeat" this function to grab/parse all strings?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard