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 / Parsing an Email to Cr...
Power Automate
Answered

Parsing an Email to Create a Lead

(0) ShareShare
ReportReport
Posted on by 1

Hello! 

 

I am needing help taking an incoming email, parsing it, and then using that data to create a lead. Our emails arrive: 


Subject: New Inbound Lead

 

Name: Test

Email: email 

Company Name: Company Name

Phone: Test

Referral: Test

Service: Test

Message: xxxxxxx

 

I've set the trigger to "when a new email arrives" and placed a subject filter. 

 

The next step is the Html to text. 

 

Where I struggle is the code required when I'm adding the information into dataverse. 

 

Any help would be appreciated. I've attached a picture of the flow. 

 

Screen Shot 2021-08-19 at 2.07.42 PM.png

 

 

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

    Hi @hosungson 

    Assume my email body like this:

    In order to distinguish 'Name' with the Name in the 'Company Name', I changed the 'Company Name' to  'Company name'.

    vLilyWmsft_0-1629427964066.png

    You can take a try with the screenshots as below:

    vLilyWmsft_1-1629428533165.png

    Name Expression:trim(first(split(last(split(outputs('Html_to_text')?['body'],'Name:')),'Email')))

    Email Expression:trim(first(split(last(split(body('Html_to_text'),'Email:')),'Company name:')))

    Company name Expression:trim(first(split(last(split(body('Html_to_text'),'Company name:')),'Phone:')))

    Phone Expression:trim(first(split(last(split(body('Html_to_text'),'Phone:')),'Referral:')))

    Referral Expression:trim(first(split(last(split(body('Html_to_text'),'Referral:')),'Service:')))

    Service Expression:trim(first(split(last(split(body('Html_to_text'),'Service:')),'Message:')))

    Message Expression:trim(first(split(last(split(body('Html_to_text'),'Message:')),'Best Regards')))

    vLilyWmsft_2-1629428552965.png

    When the email arrives, the new row with these info will be added:

    vLilyWmsft_3-1629429071337.png

    Hope the content above may help you.

    Best Regards

    If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 112 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 52

#3
Ellis Karim Profile Picture

Ellis Karim 51 Super User 2026 Season 1

Last 30 days Overall leaderboard