cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Email text to rows in excel spreadsheet

Hello!

I’m throwing myself in to a new world of string and substring in my quest for completing email text to rows in excel spreadsheet. But the problem is that I’m new at this and I can’t get it right

Email looks like this (html):

customer:             Company1
assignment:           Styr
Number:                35557
Form:                    hire
spec:                     19/11-19
press:                    10/12-19
Start:                     2 jan 2020
Price/h:                 450
TB:                        300
TG%:                     10%
KA:                        namn name
Name KA:              name name
PA:                        name name
City:                      Oslo
Order:                   namn
area:                     IT

 

Spreadsheet has the same amount of columns as above

The Flow:

  1. When new email arrive
  2. HTML to Text -> body
  3. Insert a new row in table -> orders.xlsx

 

I tried to use matching regular expression but that fails on emails that is html. I tried:  first(skip(split(first(split(body('Html_t….  But I´m no confident on using Flow/Power automate expression (fx)

 

Could someone give me a direction and a start on how to get this right?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Email text to rows in excel spreadsheet

Hey @Mikael1 

 

Yes. It will involve a lot of string manipulations and might break just in case a line misses some identifier or a delimiter.You can check the sample below: 

 

S1.PNG

 

S2.PNG

 

S3.PNG

 

Expressions: 

1. split(outputs('Compose'),variables('enter'))
2. split(items('Apply_to_each'),':')

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

3 REPLIES 3
Highlighted
Dual Super User III
Dual Super User III

Re: Email text to rows in excel spreadsheet

Hey @Mikael1 

 

There are a lot of string manipulations that you will have to do for this. Beginning with, you can start splitting each line on the enter key and then each item in this array (basically every line on the enter key) to be split on a space or a ':' and then use the string to populate the excel. 

 

You can initialize a string variable and hit an enter there to add it later to the split expression. something like I have shown here: https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/10-MS-Flow-hacks-troubleshoots-wor... 

 

And then use the apply to each control for each line item and again split on a space key or a ':'. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Frequent Visitor

Re: Email text to rows in excel spreadsheet

Thanks @yashag2255 

 

From what I could tell this will be a lot of work to get this right. 

Could you give me any example for the 2 first rows?

 

Best regards

Micke

Highlighted
Dual Super User III
Dual Super User III

Re: Email text to rows in excel spreadsheet

Hey @Mikael1 

 

Yes. It will involve a lot of string manipulations and might break just in case a line misses some identifier or a delimiter.You can check the sample below: 

 

S1.PNG

 

S2.PNG

 

S3.PNG

 

Expressions: 

1. split(outputs('Compose'),variables('enter'))
2. split(items('Apply_to_each'),':')

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (3,942)