I have an autogenerated email from a third party service that comes to my inbox.
I want to create a new Task in Planner with title which is a extracted string of text from the email body. However the length of the string can vary and is not predictable. I tried splitting the string however I'm getting an error where I am unable to insert the Title and so the create a task action fails.
The text to extract is bold part from the excerpt of the email body below:
cardellaOpportunity NameHeavy electric truck - planarAccount ID#
The two words : Opportunity Name , Account ID# are predictable and repetitive. I've converted the email to plain text however I'm unable to insert this extract into the title. I tried the function below in the title section of the new planner task but it doesn't work:
first(skip(split(first(split(body('Html_to_text'),'Opportunity Name')),'Account ID'),1))
Solved! Go to Solution.
Hi!
I would try with the following:
first(split(split(body('Html_to_text'),'Opportunity Name')[1],'Account ID'))
Hope this helps
Proud to be a Flownaut!
Hi!
I would try with the following:
first(split(split(body('Html_to_text'),'Opportunity Name')[1],'Account ID'))
Hope this helps
Proud to be a Flownaut!
Take a look at my example below - I think it may solve your issue.
Here is the expression that I used:
first(split(last(split(outputs('Email_String'),'Opportunity Name')),'Account ID#'))
The following seemed to work too.
last(split(first(split(body('Html_to_text'),'Account ID#')), 'Opportunity Name'))