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
Power Automate News & Announcements

Power Automate News & Announcements

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

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,202)