Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

parsing text from email to Sharepoint list without html to text connector

(0) ShareShare
ReportReport
Posted on by 16

Hello, I am trying to parse text from an incoming email to a Sharepoint list like it is described in this tutorial (https://youtu.be/OrCs36S3w3w).

 

The difference is that the incoming email is already in text instead of HTML.

So I skipped the HTML to text connector and changed the expression for parsing the text like this:

 

original expression: first(skip(split(first(split(body('Html_to_text'),'Quantity')),': '),1))

adjusted: first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))


Intention is to skip the not required "HTML to text" and get the text directly out of the email body.

But unfortunately I get the message that the printout is invalid.

Can anyone help me?

  • Henning12345 Profile Picture
    16 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    Thank you very much...you are really awesome 😄

  • Verified answer
    wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    Put the expression trim() around the full expression and it will remove the beginning and ending spaces.

     

    trim(first(skip(split(triggerOutputs()?['body/body'],'Delivery Method:'),1)))

    Or for your example

    trim(first(skip(split(triggerOutputs()?['body/body'],'Nachrishtentext:'),1)))
  • Henning12345 Profile Picture
    16 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    thank you very much again. It works almost perfect the only minor error is that the parsed text does not start with the first letter. the is space or line break before. first picture is the incoming email and the second is the result in the form

  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    Thank you for the photo of the email format. That made a difference. If you ask for help again on the forum it is beneficial to include your specific information for your flow. Especially screenshots.

     

    The space at the end of 'Delivery Method: ' is what is causing the problem. The split is looking for a space to be after the colon: so when it doesn't find a space it doesn't do the split.

     

    Your email doesn't have a space after your word 'Nachrichtentext: ' like the split expression is searching for.

    Your email has a line break which is different than a space. So basically remove the space to make it 'Nachrichtentext:' and you will get the remaining text.

     

    first(skip(split(triggerOutputs()?['body/body'],'Delivery Method:'),1))

    Or using your example

    first(skip(split(triggerOutputs()?['body/body'],'Nachrishtentext:'),1))

     

    I tested with my flow and it worked. It should work for you as well.

  • Henning12345 Profile Picture
    16 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    thank you very much for your great support. Sadly the expression doesn't work so far - the expression is providing no result. I added a screenshot of the incoming email and the expression of your reply adjusted with the entry of the incoming mail.

     

    first(skip(split(triggerOutputs()?['body/body'],'Nachrichtentext: '),1))

     

    the expression should provide the result: test test test --> but the result is: 0

     

     

  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    I think it would help if you separated the individual expressions within the full expression for each final output you are trying to get.

    The video link doesn't do a good job explaining what is going on within the expression, so it is difficult for to catch errors or adjust for any changes with your text or email.

     

    To separate the first expression which gets the example Cookie Type there are 5 individual expressions that builds the full expression.

     

    first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))

     

    The full Cookie Type expression says:

    1. Split the email body into separate parts/items whenever the term "Quantity" appears.

     

    split(triggerOutputs()?['body/body'],'Quantity')

     

    • Next take the First output of the split body

     

    first(split(triggerOutputs()?['body/body'],'Quantity'))

     

    • Next Split the first output of the split body whenever the text colon with a space ": " appears.

     

    split(first(split(triggerOutputs()?['body/body'],'Quantity')),': ')

     

    • Next Skip the first item after splitting by the colon space ": "

     

    skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1)

     

    • Next take the First output which will be the final result of Cookie Type

     

    first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))

     

     

    To separate the second expression which gets the example Quantity there are also 5 individual expressions that builds the full expression.

     

    first(skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1))

     

     

    The full Quantity type expression says:

    1. Split the email body into separate parts/items whenever the term "Delivery Method" appears.

     

    split(triggerOutputs()?['body/body'],'Delivery Method')

     

    • Next take the First output of the split body

     

    first(split(triggerOutputs()?['body/body'],'Delivery Method'))

     

    • Next Split the first output of the split body whenever the term Quantity colon with a space "Quantity: " appears.

     

    split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: ')

     

    • Next Skip the first item after splitting by the term Quantity colon space "Quantity: "

     

    skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1)

     

    • Next take the First output which will be the final result of Quantity

     

    first(skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1))

     

     

    The final expression which gets the Delivery Method only has 3 individual expressions that builds the full expression. However, it will get all remaining text in the email if there is anything like a Signature Name in the email body.

     

    first(skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1))

     

    The full Delivery Method type expression says:

    1. Split the email body into separate parts/items whenever the term "Delivery Method: " appears.

     

    split(triggerOutputs()?['body/body'],'Delivery Method: ')

     

    • Next Skip the first 1 output item of the previous split body

     

    skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1)

     

    • Next take the First 1 output of the previous output

     

    first(skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1))

     

     

    I made an example flow that split the full expressions into each of it's individual expressions. The example flow uses the previous output to fill in the next expression value.

    So Step A1 is the first part of the expression for Cookie Type, and then Step A2 uses the output of A1 to use it's individual expression. The final step A5 will be the same output as the full expression in A99 for cookie type.

    The A99 step, B99 step, C99 step are all full expressions that would be similar to what you would use in your flow.

    Full Example FlowFull Example Flow

    I separated my example flow into different Scope for each full expression.

     

    Scope A is for the Cookie Type

    Example Flow Scope A Cookie TypeExample Flow Scope A Cookie Type

    Scope B is for the Quantity

    Example Flow Scope B QuantityExample Flow Scope B Quantity

    Scope C is for the Delivery Method

    Example Flow Scope C Delivery MethodExample Flow Scope C Delivery Method

     

    The results of my example flow show how each individual part of the expression is using the outputs of the previous flow step.

     

    I made an example Plain Text email for the trigger body.

    The difference with my example email is that it has additional name signature information at the end. I included that to show that the final expression for Delivery Method will pull in additional text from the email body if it is not correctly changed for your situation.

     

    Below is the example Email I used:

    Example Email Plain TextExample Email Plain Text

     

    Below is the results of Scope A to get Cookie Type:

    1. Split the email body into separate parts/items whenever the term "Quantity" appears.

     

    [
     "Cookie Type: Chocolate Chip\r\n",
     ": 20\r\nDelivery Method: Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
    ]

     

    • Next take the First output of the split body

     

    Cookie Type: Chocolate Chip

     

    • Next Split the first output of the split body whenever the text colon with a space ": " appears.

     

    [
     "Cookie Type",
     "Chocolate Chip\r\n"
    ]

     

    • Next Skip the first item after splitting by the colon space ": "

     

    [
     "Chocolate Chip\r\n"
    ]

     

    • Next take the First output which will be the final result of Cookie Type

     

    Chocolate Chip

     

    Results Scope A Cookie TypeResults Scope A Cookie Type

     

    Below is the results of Scope B to get Quantity:

    1. Split the email body into separate parts/items whenever the term "Delivery Method" appears.

     

    [
     "Cookie Type: Chocolate Chip\r\nQuantity: 20\r\n",
     ": Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
    ]

     

    • Next take the First output of the split body

     

    Cookie Type: Chocolate Chip
    Quantity: 20

     

    • Next Split the first output of the split body whenever the term Quantity colon with a space "Quantity: " appears.

     

    [
     "Cookie Type: Chocolate Chip\r\n",
     "20\r\n"
    ]

     

    • Next Skip the first item after splitting by the term Quantity colon space "Quantity: "

     

    [
     "20\r\n"
    ]

     

    • Next take the First output which will be the final result of Quantity

     

    20

     

    Full Scope B results

    Scope B ResultsScope B Results

     

    Below is the results of Scope C to get Delivery Method

    Delivery Method type expression says:

    1. Split the email body into separate parts/items whenever the term "Delivery Method: " appears.

     

    [
     "Cookie Type: Chocolate Chip\r\nQuantity: 20\r\n",
     "Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
    ]

     

    • Next Skip the first 1 output item of the previous split body

     

    [
     "Pigeon\r\n\r\n\r\nMYName And Signature\r\nMyPhoneNumber 888-999-9999\r\n"
    ]

     

    • Next take the First 1 output of the previous output

     

    Pigeon
    
    
    MYName And Signature
    MyPhoneNumber 888-999-9999

     

    Results Scope C Delivery MethodResults Scope C Delivery Method

    I hope these examples help you create an expression to get the information you need. It is probably best if you understand the individual expressions that are building the full expression so that you can adjust or change things to accommodate your individual situation.

     

    Cookie Type Full Expression:

     

    first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))

     

    Quantity Full Expression:

     

    first(skip(split(first(split(triggerOutputs()?['body/body'],'Delivery Method')),'Quantity: '),1))

     

    Delivery Method Full Expression:

     

    first(skip(split(triggerOutputs()?['body/body'],'Delivery Method: '),1))

     

     

    Let me know if this works for you,

  • Henning12345 Profile Picture
    16 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    I am still struggling with the expression for the last part. I used your expression for the middle text, but the for the last one I am told that my expression is not guilty.

     

    I used this one:

    first(skip(split(triggerOutputs()?['body/body‘],’Beschreibung:’)),1))
     
    In the original tutorial the expression is:
    first(skip(split(body('Html_to_text'),'Delivery Method: '),1)) 
     
    Would be perfect if you could fix the expression 🙂
     
  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    Great! Glad to hear it is working.

    If this post is resolved please mark the response as a solution so other people can easily reference it.

  • Henning12345 Profile Picture
    16 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    thank you very much. your expression is working 🙂 , but in my incoming email there is a dress to be parsed - using the the trim() it would only parse the first word of the text.

     

    Thank you very much for support

  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: parsing text from email to Sharepoint list without html to text connector

    Can you show a screenshot of the incoming email how it looks in your inbox and also a screenshot of the input results of your flow that failed with the error? It would be helpful to see what you have.

     

    I used the expression below and was able to get a Plain Text Email body to give me the response Chocolate Chip like in the video example.

    first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1))

     

    wskinnermctc_0-1675378605216.png

     

    I would add a Trim() to the expression so that it removes any trailing or leading spaces or line breaks.

    trim(first(skip(split(first(split(triggerOutputs()?['body/body'],'Quantity')),': '),1)))

     

    (Note: When I was testing, right after I pressed Save and Test, I kept getting a message "Cannot read properties of undefined (reading 'properties')" and the flow would not test. However, I would just press the Save and Test again, and the flow would work. Seems like it is probably because I keep reusing a test flow for looking at questions on here.)

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow