Hello community,
I need to build the following workflow.
An email will be frequently send to me. The mail should be converted to a wordpress post.
The email has a defined style. It looks like the following:
+++ Headline is here +++ Text is here ... lots of text ... over multiple lines ... but the ending is also the same... ending with "via automated workflow" https://shortlink |
How can I extract the headline between "+++ " and " +++" as well as the report with in the " +++" and the https link?
I tried with composing the mail text and split it, but somehow this does not work 😞
Solved! Go to Solution.
Provided the format is identical or nearly identical to the above every time, first, convert the body of the email to text using the HTML to Text action.
Next, use a compose function with the "Split" expression to split at the +++. This gives an array with 3 indexes. Index 2 is your header and index 3 is the rest of the text. Expression: split(variables('Text'),'+++')
You can add a trim() to the expression to remove the whitespace before and after.
If this part will always be at the end: "via automated workflow" https://shortlink, you can split at the text "via automated workflow" and get everything after. You may need to do a little bit of cleanup to get rid of characters and whitespace depending on how exactly it comes through via email.
Expression: split(variables('Text'),'via automated workflow')[1] - (We use the [1] at the end to access that index in the array.)
Provided the format is identical or nearly identical to the above every time, first, convert the body of the email to text using the HTML to Text action.
Next, use a compose function with the "Split" expression to split at the +++. This gives an array with 3 indexes. Index 2 is your header and index 3 is the rest of the text. Expression: split(variables('Text'),'+++')
You can add a trim() to the expression to remove the whitespace before and after.
If this part will always be at the end: "via automated workflow" https://shortlink, you can split at the text "via automated workflow" and get everything after. You may need to do a little bit of cleanup to get rid of characters and whitespace depending on how exactly it comes through via email.
Expression: split(variables('Text'),'via automated workflow')[1] - (We use the [1] at the end to access that index in the array.)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
65 | |
51 | |
30 | |
29 | |
24 |