cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Devinm501
Helper II
Helper II

Extracting specific text from email body

Hi,

 

I am trying to set up a flow to extract specific lines from the body of an email.

I currently want all information highlighted in red to point to specific columns within sharepoint:  

 

Column 1:

Short description: Suspicious Domain Registration Identified:
EXAMPLE-Uk-Plc[.]com

Description:

 

Column 2:

Domain Registered:
* EXAMPLE-Uk-Plc[.]com (34.102.136.180, Geo-location: Missouri - Kansas
City)
Date of registration:

 

Currently I have tried to only extract the text for column 1 and have come up with the following: 

 

Compose:

length(body('Html_to_text'))

Compose 2: 

add(indexOf(body('Html_to_text'),'Short Description:'),18)

Compose 3:

indexOf(body('Html_to_text'),'Description')

Compose 4: 

substring(body('Html_to_text'),outputs('Compose_2'),sub(outputs('Compose_3'),outputs('Compose_2')))

 

The I have the output rom compose 4 in the Column 1 option when creating an item in sharepoint.

 

I seem to be getting an error due to the length of the substring being too long and am unsure how to fix this. The whole email is quite lengthy so not sure if I'm breaking it down correctly and my end point isnt specific?

 

Any help would be appreciated and any more info needed please ask.

 

Thank you,

Devin

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Devinm501 

 

Please see below.

 

image.png

 

Above expression I used is as follows:

first(Split(last(split(outputs('Compose'),'Short description:')),'Description:'))

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

3 REPLIES 3
abm
Super User
Super User

Hi @Devinm501 

 

Didn't understand fully about your requirement.

 

Short description: Suspicious Domain Registration Identified:
EXAMPLE-Uk-Plc[.]com

 

This all in one text?

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Hi @abm 

 

Apologies if i haven't explained very well. Basically i want to send the text in red (Which sits within an email) to a column in sharepoint: 

 

Column 1:

Short description: Suspicious Domain Registration Identified:
EXAMPLE-Uk-Plc[.]com

Description:

 

the way ive tried to do this is basically separate everything from the end of the colon "Short Description:" and take all the text up until the word "Description". for some reason i can't get this working and appear to be getting an error due to the length of the substring being above 2197.

 

does that explain any better?

 

Thank you in advance.

Hi @Devinm501 

 

Please see below.

 

image.png

 

Above expression I used is as follows:

first(Split(last(split(outputs('Compose'),'Short description:')),'Description:'))

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,215)