cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mikael1
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
yashag2255
Dual Super User II
Dual Super User II

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
yashag2255
Dual Super User II
Dual Super User II

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!

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

yashag2255
Dual Super User II
Dual Super User II

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (36,040)