web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Email content into sep...
Power Automate
Answered

Email content into separate rows in Excel

(0) ShareShare
ReportReport
Posted on by 19

 

Hi everyone,
I need to extract the content out of an email (rough example below) and save it in excel table.
There is always one Order but the number of ‘Part Numbers’ is variable (at least 1) per email.
I created a flow that splits/trims the body and ultimately puts the content of single e-mail into one row but I need to have all part numbers in separate rows, as per attached examples.
obraz_2023-03-20_153828242.png

 

 

 

 

 

 

 

 

obraz_2023-03-20_153859126.png

 

 

 

 

 

 

 

 

 

SupaMC_0-1679323092258.png

 

 
Do you have any tips, or know any tutorial on how to fix it?
Many thanks!
Categories:
I have the same question (0)
  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Here is a logic to split new line text. Could you try to apply same in your flow.

     

    Kaif_Siddique_0-1679341614263.png

     

    Kaif_Siddique_1-1679341655483.png

     

    Compose 2:

    trim(Split(Split(outputs('Compose'),'Order Number:')?[1],'Part numbers:')?[0])

     

    Compose 3:

    split(trim(Split(outputs('Compose'),'Part numbers:')?[1]),decodeUriComponent('%0A'))

     

    Apply to each

    {outputs('Compose_3')}

     

    Compose 4:

    {items('Apply_to_each')}

     

     

    Regards

    Kaif

  • SupaMC Profile Picture
    19 on at

    thanks,

     

    I adapted your flow accordingly but got following error on "apply to each"

    obraz_2023-03-21_105014656.png

    One additional remark to 'body'.

    Right after list of Part Numbers there is additional text (starting with 'You will (..)' that I do not need, so it should be excluded.

    Same with 'null' next to Part Number

     

    SupaMC_0-1679398731872.png

     

     

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Update Compose 3:

    Kaif_Siddique_0-1679511985030.png

     

    split(trim(Split(Split(outputs('Compose'),'Part numbers:')?[1],'You will')?[0]),decodeUriComponent('%0A'))

     

     

  • SupaMC Profile Picture
    19 on at

    Thanks!

    We are almost there, hopefully last issue...

     

    Output of compose 3 ('part numbers') seems to be fine but still some blank cells are added to the table which are not needed.

    I noticed it happens when there are more than 1 mail sent at the same time (which is more than probable).

     

    Additionally, is there any quick solution go get rid of text after '='?

     

    obraz_2023-03-23_121548245.png

     

    SupaMC_0-1679567563363.png

     

    EDIT:
    I created additional column (that indicated 'empties') and two more actions in order to delete the empties, but they have not been found, despite they were there..

    obraz_2023-03-23_125300911.pngobraz_2023-03-23_125423910.pngobraz_2023-03-23_125318550.png

    Any ideas?

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    To remove '=' use replace function

    Kaif_Siddique_0-1679686103946.png

    replace(items('Apply_to_each'),'=','')

     

    To delete records add the below step:

    Kaif_Siddique_1-1679686154487.png

     

    If I have answered your question, please mark my post as Solved.

    If you like my response, please give it a Thumbs Up.

     

    Regards

    Kaif

  • SupaMC Profile Picture
    19 on at

    Hi,

    I need to delete not only '=' but everything after (and including) '=', see below - only green text should stay.

     obraz_2023-03-27_085704513.png

     

    This one above doesn't work anyway as it creates two lines for each number, one with '=', second without

    obraz_2023-03-27_085621103.png

     

  • Verified answer
    Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    update replace with below expression.

    Kaif_Siddique_0-1679943432878.png

    trim(first(split(items('Apply_to_each'),'=')))

     

    If I have answered your question, please mark my post as Solved.

    If you like my response, please give it a Thumbs Up.

     

    Regards

    Kaif

  • SupaMC Profile Picture
    19 on at

    exactly what I needed, thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard