cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alice_italy
Helper I
Helper I

extract string from Message of outlook into an excel sheet

hello all,

I need to extract a string from an email like the example:

 

PERSON: XYZ

BOX: 9999

ID:999

 

the flow have to take the informations of PERSON, BOX and ID, then put into an excel file the records

 

how I can?

 

thanks to all who help me

8 REPLIES 8
efialttes
Super User
Super User

Hi!

I would add an 'HTML to text' action block, assign as its input email body.

Next, I would use the following WDL expression to extract PERSON value

 

 

trim(first(split(last(split(body('HTML_to_text'),'PERSON:')),'BOX:')))

 

 

Similar approach for BOX:

 

 

trim(first(split(last(split(body('HTML_to_text'),'BOX:')),'ID:')))

 

 

Now, the ID is a little more tricky. We need a pattern always present after BOX value. Assuming a new line is always at its end I would try with the following WDL expression...

 

 

trim(first(split(last(split(body('HTML_to_text'),'ID:')),'
')))

 

 

...in this last WDL expression please remember to hit Enter key from your keyboard in between the last two single quotes

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!



Hi @efialttes,thanks for your support,

 

I try following your instruction, like this?

 

attached you find also an e-mail sample and the excel result2.PNG1.PNGCattura.PNG

 

thanks to your support

 

 

 

Hi!

You added WDL expressions as plain text, which is a wrong approach.

Since you are unfamiliar with WDL expressions, please follow these steps to add them to an action block (both the expression and the action block in the video are not related to this issue):

https://youtu.be/LPZ-WZoWwp4

 

If video is not enough, this link is also helpful:

https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/

 

Thanx!

 



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!



Thank you for your support, but, unfortunately, the COMPOSE doesn't accept the formulas

Hi!

As per your last screenshot I have realized you have 3 'HTML to text' action blocks and you also renamed them... this means you need to rebuild the WDL expressions I suggested relacing the standard name and using the new one

So if you rename 'HTML to text' into 'HTML to text Alice' you need to replace body('HTML_to_text') and use body('HTML_to_text_Alice') instead

 

Remember to replace spaces with _

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!



One more comment:

You just need one 'HTML to text' action block, assign as its input email body from dynamic content menu.

Flow_HTML2Text.png

Then I would add 3 different 'Compose' action blocks, assign the 3 suggested WDL expressions to each of them

 

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!



unfortunately, doesn't work

@Alice_italy 

I'm truly sorry, without a good screenshot of your current flow design and more information context I cannot suggest anything else. Good luck with your challenge and let's hope somebody else can point you to the right direction!

 



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!



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 (5,056)