--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools



Recently Changed Pages:

View All Pages

View All Tags

WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.

Pages with comments

2019/11/18 13:52 1 Comment

View All Comments


Use Flow to Parse Email Body to SharePoint Online List Items

This is one of the more complex things you might want to do with flow. It takes a lot of work, and it is very imported the email you want to parse has a structure so you can put some logic into it.

The Email

This is the format of the email we want to process. Note that all kinds of fields are possible as long as it the same format and matches the field input in the SharePoint list.

phone: +31612345678
request: I'd like to change the color of the main page to purple

As you see we have 4 datafields, Domainname, email, phone and request.

Before we Start

Please notice these things:

  • Keep the case in mind. I've had trouble with flow when I accidentily changed UpperCase to LowerCase and vice versa.
  • We process the data by determining the start of the data, and the start of the next datafield. Then we'll get the data in between. This means we'll need three compose actions per datafield
  • The last datafield does not have a next datafield, so for the last datafield we'll use the length of the body to determine the end of the datafield

The Flow

This is an overview of the flow. As you can see it's quite long:
The details of “Html to text” and the first Compose Action. It is very important to rename all of your compose actions to keep track of them. See the details below for the exact expression:
The details of the Create Item action:

Note that also in the ComposeGetDomainname the warning “We can't find any output to match this input format” is displayed. After you click “See more” you'll have the option to select “Output”


  • Compose Action (rename after creation):
    • ComposeStartDomainname: add(indexOf(Body('Html_to_text'),'Domainname'),12)
    • ComposeEndDomainname: indexOf(body('Html_to_text'),'email')
    • ComposeGetDomainname: substring(body('Html_to_text'),outputs('ComposeStartDomainname'),sub(outputs('ComposeEndDomainname'),outputs('ComposeStartDomainname')))

Use these for the last datafield (request in my case):

  • Compose Action (rename after creation):
    • ComposeStartRequest: add(indexOf(Body('Html_to_text'),'request'),9)
    • ComposeLength: length(body('Html_to_text'))
    • ComposeGetRequest: substring(body('Html_to_text'),outputs('ComposeStartRequest'),sub(outputs('ComposeLength'),outputs('ComposeStartRequest')))


The expressions use the following functions:

  • sub: Return the result from subtracting the second number from the first number.
  • indexOf: Return the starting position for a substring.
  • substring: Return characters from a string, starting from the specified position.
  • add: Return the result from adding two numbers.

You can read here more about the functions.


Enter your comment. Wiki syntax is allowed:
B​ S I O​ P
flowemailtosharepointlist.txt · Last modified: 2019/11/18 12:23 (external edit)