cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Davidn7
Regular Visitor

How to get specific parts of string

Hi. I have an outlook mailbox mensage in the following format:

 

Email notification!

text1/ text2 / text3/ text4 

Thank you for using our Plataform!

How can i extract:
text1

text2 

text3

text3

 

Thank you for your support

 

1 ACCEPTED SOLUTION

Accepted Solutions
Sundeep_Malik
Community Champion
Community Champion

Hey @Davidn7 

I have a solution for you if the body of the email remains static always like the above case.

Do the following:

First use html to text action:

Sundeep_Malik_0-1664468476106.png

Take a string variable with empty line:

Sundeep_Malik_2-1664468539228.png

 

 

After that use the following expression in a compose:

split(split(replace(outputs('Html_to_text')?['body'],'/',''),variables('A'))[2],' ')

Sundeep_Malik_1-1664468489223.png

Firstly I have done replace to remove the / slash. After that I am splitting whereever it finds an extra line. So while using the html to text an extra line comes. After that I am using another split to just take out the text values.

You can also use separate compose actions and expressions as well:

Separate expressions:

replace(outputs('Html_to_text')?['body'],'/','')

split(outputs('Compose_2'),variables('A'))

split(outputs('Compose_3')[2],' ')

Sundeep_Malik_3-1664468741521.png

 

Final Output:

Sundeep_Malik_4-1664468786282.png

 

 

View solution in original post

1 REPLY 1
Sundeep_Malik
Community Champion
Community Champion

Hey @Davidn7 

I have a solution for you if the body of the email remains static always like the above case.

Do the following:

First use html to text action:

Sundeep_Malik_0-1664468476106.png

Take a string variable with empty line:

Sundeep_Malik_2-1664468539228.png

 

 

After that use the following expression in a compose:

split(split(replace(outputs('Html_to_text')?['body'],'/',''),variables('A'))[2],' ')

Sundeep_Malik_1-1664468489223.png

Firstly I have done replace to remove the / slash. After that I am splitting whereever it finds an extra line. So while using the html to text an extra line comes. After that I am using another split to just take out the text values.

You can also use separate compose actions and expressions as well:

Separate expressions:

replace(outputs('Html_to_text')?['body'],'/','')

split(outputs('Compose_2'),variables('A'))

split(outputs('Compose_3')[2],' ')

Sundeep_Malik_3-1664468741521.png

 

Final Output:

Sundeep_Malik_4-1664468786282.png

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (5,206)