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

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
    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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard