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

Community site session details

Session Id : Gc8Wy+jcYMYG0tdHBVcdS+
Power Automate - Building Flows
Answered

How to scrape the text in a email to create a Lead in CRM

Like (0) ShareShare
ReportReport
Posted on 17 Dec 2023 20:04:04 by 8

Hi 

I have the below email to scrape, i have looked at other forum posts but i can't get it to work as my message doesn't have any : and when i split it into a array it doesn't split into a seperate line.

 

srs00_0-1702843156955.png

 
    "How can we help you?  Current Apprentice Enquiry Which training centre is",
    "closest to you?  A Your Message  Test message First Name  O Last",
    "Name  T Email  o Phone  02",
    "",
    "[https://.wordpress.clearstate.co/wp-json/wp-mail-smtp/v1/e/ZGF0YSU1QmVtYWlsX2xvZ19pZCU1RD0yNiZkYXRhJTVCZXZlbnRfdHlwZSU1RD1vcGVuLWVtYWlsJmhhc2g9YzFiNGVmMTE0OTMyNDBjY2QwMzZjMTVjZDE0MzExMGU5NmQ4NzhhMTkyNzViMjAyMjgyYWYxZDVjYTMxMzA3Nw==]",
    "This email and any files transmitted with it are confidential and is intended",
    "only for the individual named. If you are not the named addressee you should not",
    "disseminate, distribute or copy this email. Please notify the sender immediately",
    "by email if you have received this email by mistake and delete this email from",
    "your system."
]
I have the same question (0)
  • Verified answer
    v-yetonggu-msft Profile Picture
    on 18 Dec 2023 at 01:31:36
    Re: How to scrape the text in a email to create a Lead in CRM

    Hi @srs00 ,

    I did a test for your reference.

    In my scenario:

    vyetonggumsft_0-1702862922030.png

    vyetonggumsft_1-1702863001201.png

    trim(split(split(outputs('Html_to_text')?['body'],'Which')[0],'help you?')[1])
    trim(split(split(outputs('Html_to_text')?['body'],'Your Message')[0],'closest to you?')[1])
    trim(split(split(outputs('Html_to_text')?['body'],'First Name')[0],'Your Message')[1])
    trim(split(split(outputs('Html_to_text')?['body'],'Last Name')[0],'First Name')[1])
    trim(split(split(outputs('Html_to_text')?['body'],'Email')[0],'Last Name')[1])
    trim(split(split(outputs('Html_to_text')?['body'],'Phone')[0],'Email')[1])
    trim(split(outputs('Html_to_text')?['body'],'Phone')[1])

    Best Regards,

    Sunshine Gu

     

  • ssr001 Profile Picture
    8 on 18 Dec 2023 at 01:55:29
    Re: How to scrape the text in a email to create a Lead in CRM

    It gives this error Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'trim(split(split(outputs('Html_to_text')?['body'],'Which')[0],'help you?')[1])' cannot be evaluated because property 'body' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

  • v-yetonggu-msft Profile Picture
    on 18 Dec 2023 at 02:00:25
    Re: How to scrape the text in a email to create a Lead in CRM

    Hi @srs00 ,

    Please show your complete flow screenshot.

     

    Best Regards,

    Sunshine Gu

  • ssr001 Profile Picture
    8 on 18 Dec 2023 at 02:03:32
    Re: How to scrape the text in a email to create a Lead in CRM

    srs00_0-1702864998915.png

     

  • v-yetonggu-msft Profile Picture
    on 18 Dec 2023 at 02:15:38
    Re: How to scrape the text in a email to create a Lead in CRM

    Hi @srs00 ,

    Delete the triggers and controls I circled and re-add 'When an new email arrives (V3)' trigger and 'Html to text' control, pull the 'Add a row' control outside the 'Apply to each' loop, and then put the corresponding compose output into the corresponding parameter of 'Add a row'.

    vyetonggumsft_2-1702865703644.png

     

    Best Regards,

    Sunshine Gu

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard
Loading complete