cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sagarkane
New Member

Add a specific string of email body as Planner title

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))

 

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User
Super User

Hi!

I would try with the following:

first(split(split(body('Html_to_text'),'Opportunity Name')[1],'Account ID'))

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
efialttes
Super User
Super User

Hi!

I would try with the following:

first(split(split(body('Html_to_text'),'Opportunity Name')[1],'Account ID'))

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



ScottShearer
Super User
Super User

@sagarkane 

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#'))

image.png

image.png

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

The following seemed to work too.

 

last(split(first(split(body('Html_to_text'),'Account ID#')), 'Opportunity Name'))

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,482)