
Announcements
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.
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'.
You can take a try with the screenshots as below:
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')))
When the email arrives, the new row with these info will be added:
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.