Summary: How to use Microsoft Flow (Power Automate) to parse an email body to a SharePoint Online List.
Date: Around 2020
Refactor: 1 March 2025: Checked links and formatting.
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.
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.
Domainname: website.nl email: info@website.nl 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.
Please notice these things:
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”
add(indexOf(Body('Html_to_text'),'Domainname'),12)
indexOf(body('Html_to_text'),'email')
substring(body('Html_to_text'),outputs('ComposeStartDomainname'),sub(outputs('ComposeEndDomainname'),outputs('ComposeStartDomainname')))
Use these for the last datafield (request in my case):
add(indexOf(Body('Html_to_text'),'request'),9)
length(body('Html_to_text'))
substring(body('Html_to_text'),outputs('ComposeStartRequest'),sub(outputs('ComposeLength'),outputs('ComposeStartRequest')))
The expressions use the following functions:
You can read here more about the functions.