Hi community,
I am a beginner with Index strings and need help to extract words in the first line of an email.
Reading through existing threads, I can see a few examples of text extraction using various Compose actions. However, they all seem to pick up text after a certain marker, or text that contains specific words/characters. In my case, that is an issue because there wouldn't be any standard wording in the email body. The only constant is the location of that text: always the first line, unless text is absent.
Context: Users are forwarding an email message containing an invoice to a dedicated inbox. This triggers a flow to automate a tracking process. If the user adds text before sending the message, I want to extract that text, which I'll refer to as "Description". An example of description could be: Client 1.
The output would be used for 2 purposes:
A few considerations:
Would love if someone could confirm if that is achievable in Power Automate and to walk me through the various steps. Thanks in advance.
Clarifying that my flow works fine to create files from each attachment, as well as to create rows in the Excel table using standard dynamic content. The part that I need help solving is how to pull that Description from the email body (first line of text).
Solved! Go to Solution.
Hi @mgauvin,
If you want to get the first line of the Email body, you could refer to the following steps to do it:
split(outputs('Compose'),variables('Line'))[0]
If it is a forward Email and it doesn't contain any description in the body. There is no ---Forwarded Email---- mentioned in the beginning of Email body, but there will be start with "Form:", so you could use startswith() function to determine whether to extract first line of Email.
If you want to get the first 30 characters, you could use the substring() function to do it:
substring('firstLineofEmailBody',0,30)
But if the first line has no 30 characters the expression will report an error, so you should use length() function to determine it whether is longer than 30 characters firstly.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mgauvin,
If you want to get the first line of the Email body, you could refer to the following steps to do it:
split(outputs('Compose'),variables('Line'))[0]
If it is a forward Email and it doesn't contain any description in the body. There is no ---Forwarded Email---- mentioned in the beginning of Email body, but there will be start with "Form:", so you could use startswith() function to determine whether to extract first line of Email.
If you want to get the first 30 characters, you could use the substring() function to do it:
substring('firstLineofEmailBody',0,30)
But if the first line has no 30 characters the expression will report an error, so you should use length() function to determine it whether is longer than 30 characters firstly.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-litu-msft ,
This is exactly what I am looking for,
I would like to take the first line from an email and update a SharePoint list with that information,
I'm new to expression, are you able to show me some screen shots on how to configure the flow to be able to get the first line from an email?
Thank you
Claire
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
70 | |
22 | |
18 | |
17 | |
13 |
User | Count |
---|---|
126 | |
37 | |
30 | |
28 | |
26 |