Power Automate - How to extract body of email which contains multiple rows?

Sdílet
Vložit
  • čas přidán 29. 07. 2024
  • This video explains how to extract body of email which contains multiple rows.
    Expressions I used in this video is as follows:
    split(outputs('HTML_to_text_2')?['body'],outputs('Compose_2'))
    last(split(outputs('Compose_4'),'Name:'))

Komentáře • 84

  • @rubenpuertosmartinez
    @rubenpuertosmartinez Před 5 měsíci +1

    Congratulations, great video! What about if I have the values in separate rows? E.g. Row1 = Name; Row2= Will Smith. is there any way to pull the information from the 'Apply to each' as I will always be receiving the same form

  • @SreeramSashankChundi
    @SreeramSashankChundi Před měsícem

    i have created a flow where when ever we receive an email(v3) the automation will copy the body and paste it in an excel sheet . but when i receive 2 emails at exact same time the flow is unable to trigger both the emails but only one some times none can you help me with this

  • @akhiljohn4145
    @akhiljohn4145 Před rokem +1

    thanks for sharing,
    I have a question on the same, if multiple parameters has to be extracted from the body like say in this video , in the yes condition box if we have extract age and gender how do you write those conditions and if the data is unstructured say if mails are received in different formats(instead of semi colon, a dash is used or details are mentioned in a single line) what method can be used.
    kindly respond!
    Thanks

    • @abm4975
      @abm4975  Před rokem

      Hi Akhil
      That will be difficult. You need a pattern of data then only you can apply the rules how to extract the data.
      Thanks

  • @gedelasaisravya2603
    @gedelasaisravya2603 Před 5 měsíci +1

    How to extract address field from a pdf which has different number of lines(2-5) for each person?

    • @abm4975
      @abm4975  Před 5 měsíci

      I don't think its supported by native connectors. You may need to look third party connectors within Power Automate. There are few out there already.
      Thanks

  • @stephanieyang9168
    @stephanieyang9168 Před rokem +1

    Hello, Thank you for these! I am trying to do this, but when it comes to the expression split, it says that it does not exist.. is there another expression that does the same thing

    • @abm4975
      @abm4975  Před rokem +1

      Hi
      Click the expression tab and type split(). Believe your cursor focus is under the Dynamic expression. Have a look on my video carefully. Split() do exists.

  • @Bornforbapa
    @Bornforbapa Před 3 měsíci +1

    This video is really usefull to me...Thanks for video...
    need one more help from you ....
    I have mail with the table in body that body table need to extrext and share some line item to the other user via mail by using power automate.

  • @TopRankDnB
    @TopRankDnB Před rokem +1

    Hi, this is excellent - I have a question if you are able to help. I would like to take certain values, loop through and add them to a row within excel, the format of each email is the same but when converted to html to text looks like:
    First Name
    Username1
    Age
    23
    First Name
    Username2
    Age
    24
    Not like your example which is:
    First Name: Username1
    Age:23
    First Name: Username2
    Age: 24
    I have an excel table which should update each column with these values received, and add a new row for each person’s info. You mention a ‘concat’ at the end of this video which may be a starting point for me?

    • @abm4975
      @abm4975  Před rokem

      Hi
      I need to see the flow to comment on this. Could you please post in Power Automate Community and tag me as @abm. I will have a look.
      powerusers.microsoft.com/t5/Building-Flows/bd-p/BuildingFlows

  • @victordauden9173
    @victordauden9173 Před rokem +1

    Super cool! I'm trying to extract just a few lines on top of a HTML table from an email received jsut ike this example you showcased, such as Customer, Invoice No.. etc. Then the table, headers Currency, Item and so on and then the content of the table itself. Any thoughts on that? thx!!!

    • @abm4975
      @abm4975  Před rokem

      Hi Victor
      Thanks for the support. So again here you have enter key or new line as separator.
      split('email body', 'EnterKey'). Please see exact syntax in my video.
      So that means it will create an array
      After the array you can access the first index to get Customer and next index to get Invoice No
      Below is the expression to get customer
      split('email body', 'EnterKey')[0]
      For invoice
      split('email body', 'EnterKey').[1]
      Hope it makes sense. If you need further help please let me know. Happy to help.
      Thanks

    • @victordauden9173
      @victordauden9173 Před rokem +1

      ​@@abm4975 thank you. Your content is unparalleled. The time you take to answer and explainin each video. Hats off to you @abm

    • @abm4975
      @abm4975  Před rokem

      Thanks a lot Victor. Really appreciate your kind comments.

  • @thewanderingcouple8378
    @thewanderingcouple8378 Před rokem +1

    Can we extract the value by using AI builder and use the last(split expression to get only value and create sharepoint list items with the value?

    • @abm4975
      @abm4975  Před rokem

      Hi
      You could try it. Why you need to use the AI builder?
      Thanks

  • @darkspeed62
    @darkspeed62 Před rokem +2

    This video is really helpful, and I love how you show the outputs at each stage so it makes more sense what you are doing. I am however confused as to how you extract more data after the true/false conditon. So, I got Irene. How then do I extract 54 within that condition, and then Female?

    • @abm4975
      @abm4975  Před rokem

      Hi
      Thanks so much for the support.
      I was away for few weeks. Do you still need help in this please?
      Thanks

    • @dernamenlose13
      @dernamenlose13 Před 10 měsíci

      Yes please, can u do a video and i like to extract the data into excel. Thanks for your help!@@abm4975

    • @dianafs7429
      @dianafs7429 Před 4 měsíci

      Hi I need help please. I have the same request@@abm4975

  • @deebantech
    @deebantech Před 9 měsíci +1

    Hello, I wanted to extract email addresses from the body and put it in array. Please help me out with the steps..

    • @abm4975
      @abm4975  Před 9 měsíci

      Hi
      I need to see a sample of text? Is the email under the body is always going to be in same position? If its in different place its quite difficult to extract it. For extracting the data you need the data to be placed under a specified format. Then we can apply those rules to get that particular data. See an example below of a body format:
      1. Name: David Smith
      2. Email: d.s@test.com
      So for the above we can look the second line and extract the email using Power Automate.
      Please tell me more about the email body of yours?
      Thanks

  • @marcussoh8445
    @marcussoh8445 Před rokem +1

    Hi what if the body is like to
    name:
    nameof the person
    how should I adjust the expression?

  • @talandria_digital_learning

    Good. Tutorial 😁

  • @adagonzalez3241
    @adagonzalez3241 Před 11 měsíci

    Would of be possible to modify this flow to ensure that the entire email message is extracted except the greeting line end ending line of the email?

    • @abm4975
      @abm4975  Před 11 měsíci +1

      Hi
      Thanks for the question and support. Yes have a look on Power Automate skip() expression.
      Thanks

  • @MrMrasimdafnqalbi
    @MrMrasimdafnqalbi Před rokem +1

    Thanks dear. What about if I want a specific item in the array? let us say number 15?

    • @abm4975
      @abm4975  Před rokem

      Hi Ali
      If you are looking for a specific item, you could add an IF condition to check the name of the item and get the specific value. Another way is using the Filter array and check item value is 15 or not? It's all depends on your data.
      Thanks

  • @sujithasureshbabu4589
    @sujithasureshbabu4589 Před 11 měsíci +1

    This video and the other one on unstructured were really useful! Saved me lots of time & effort.
    I have put them in a sharepoint list.
    There are a lot of null values before the desired result and after the desired result.
    Ex: [null,null,Sujitha, null,null].
    Could you please let me know a way to update this without the null values?

    • @abm4975
      @abm4975  Před 11 měsíci

      Hi
      Thanks for the question. Could you add an If condition to check whether its null?

    • @sujithasureshbabu4589
      @sujithasureshbabu4589 Před 11 měsíci +1

      @@abm4975 Thank you, it worked ! :)

  • @bayutrianayasa5663
    @bayutrianayasa5663 Před 9 měsíci +1

    Can u show how to export multiple body email to excell with power automate?

    • @abm4975
      @abm4975  Před 8 měsíci

      Hi
      Could you explain with an example please. I could look into it.
      Thanks

  • @user-en5if8sm5r
    @user-en5if8sm5r Před rokem +1

    how would this work for an email that sends informations in a table? I want to extract the names of the headers, and the information listed below each.

    • @abm4975
      @abm4975  Před rokem

      Hi
      Please have a look at this video from Damien.
      czcams.com/video/i4GHCGMAD88/video.html

  • @vastavchandrakesh
    @vastavchandrakesh Před rokem +1

    Hi... I get mail which has all the data can i add a filter to it and project what i needed in teams if yes can you please help me with the process ... Thanks

    • @abm4975
      @abm4975  Před rokem

      Hi
      Could you please post in Power Automate community forum. Explain using an example. Tag me as @abm. I will have a look.
      powerusers.microsoft.com/t5/Building-Flows

  • @user-hv3mf8qk4j
    @user-hv3mf8qk4j Před 2 měsíci +1

    Hi I want to store the first 500 words from the body of the mail in share point list how can I ?

    • @abm4975
      @abm4975  Před 2 měsíci +1

      Hi
      Use the expression substring('your email body', 0, 500).

    • @user-hv3mf8qk4j
      @user-hv3mf8qk4j Před měsícem

      @@abm4975 thanks

  • @arthurpurcino5
    @arthurpurcino5 Před rokem

    Hello! I have a question about e-mails that I cannot solve, but for me it seems pretty simple: Can I respond an email that my power automate flow made for me? Like: My flow sends an e-mail, and after a specific "If" function, It'll answer the e-mail for me with another message, like starting a conversation.

    • @abm4975
      @abm4975  Před rokem

      Hi
      There are no send reply action button. What you could do is get the email body from the trigger and map it in your send email action step with your custom reply.
      Thanks

  • @tonya3308
    @tonya3308 Před rokem +1

    I am using PowerAutomate to export emails to a database and then display the data in a PowerApp gallery depending on customer needs; however, many times the customer emails have pasted images and screen shots in the email. I cannot get these images to appear in a PowerApp gallery - the email text displays but the image is blank. Any ideas? I have tried using the Html text box in PowerApps as well as the Image control without any success.

    • @abm4975
      @abm4975  Před rokem

      Is that image reference is a url?
      Thanks

    • @tonya3308
      @tonya3308 Před rokem +1

      @@abm4975 In my situation, the customers have a few sentences of text, then an image they pasted into the email, maybe a few more sentences, one or two more pasted images and then maybe another sentence or two. Via power automate I save the email (based on subject content) to a sql table and save the body as varchar(max) - then the customers are able to view the email, based on filter criteria, in a powerapps gallery; however, the images do not show. I believe they are a cid and I cannot figure how to (1) make the image show in the gallery (I believe this may not be possible), and (2) how to enable the customer to click on the image url and view the cid by clicking on this email body in the powerapps gallery. Thoughts?

    • @abm4975
      @abm4975  Před rokem

      Thanks for your reply. If the images are coming from a url reference then it might be possible otherwise you need to store the images somewhere. I am not sure how to store the email embedded images?

  • @hakisterplays
    @hakisterplays Před rokem +1

    Hello Ajith. Thank you for this video. It gave me an idea on how to parse the body of the email into text. I do have one question though. Let's say instead of just extracting the name, I want to extract age and gender as well, how do I go about doing that in an Apply to Each action? I'm planning to put them in one row in an excel spreadsheet table.

    • @abm4975
      @abm4975  Před rokem +3

      Hi
      I was away for few weeks. Do you still need help in this please?
      Thanks

    • @albaharh
      @albaharh Před 11 měsíci +1

      @@abm4975 yes please, can you show us how to extract the age and gender and other values and store each value in separate column in a list please ?t
      I've been hitting my head into a wall on how to iterate more values
      It would be appreciated and Ill subscribe and like your videos to :)

    • @SravyasPassion
      @SravyasPassion Před 10 měsíci

      Hi @abm abm, Thanks for your valuable content, Even though I have the same doubt, Could you please share a flow on how to concat the values from an email body and add them into single row in a excel file

    • @dernamenlose13
      @dernamenlose13 Před 10 měsíci

      Same here@@albaharh

  • @cristobalramirezvalderrama790
    @cristobalramirezvalderrama790 Před 5 měsíci +1

    Hello, if I have a line from the message body that contains the text string "xacd" how can I get the entire line?

  • @sadhals6950
    @sadhals6950 Před rokem +1

    Hi
    I need to extract tables from email, can u pls hlp....

    • @abm4975
      @abm4975  Před rokem

      Hi
      Thanks for your question. Damo got a good video about this. Please have a look.
      czcams.com/video/i4GHCGMAD88/video.html
      Thanks

  • @JoseLuis-jn6ge
    @JoseLuis-jn6ge Před 9 měsíci +1

    Nice video, It is possible to classify emails and extract information only on emails received on business days and business hours excluding weekends and holidays and then send a Teams message to a Chat or group?

    • @abm4975
      @abm4975  Před 9 měsíci

      Hi
      Thanks for your question. Yes you can. Mail trigger got a value called 'Received Time'. This holds the datetime value of the email you received. You can check using the expression called 'dayOfWeek()' Here passing the Received Time from the trigger. This will return 0 for Sunday, 1 for Monday and so on. Add an If condition to determine if its a weekend or not and use Terminate action step to stop the flow. Again for checking the business hours you need to parse the Received Time using formatDateTime() expression. eg: formatDateTime('RecivedTime from the trigger here', 'HH:mm') This will return the the hours and minutes in 24 hour format. Again add a check to determine if its more than 17 (5 pm) then terminate the flow. You could add all these as one expression under the trigger too. Its a bit complicated. If you need further assistance let me know. Happy to help you via a screenshare. Good luck.
      Thanks

    • @JoseLuis-jn6ge
      @JoseLuis-jn6ge Před 9 měsíci +1

      Hello, thank you very much for the answer, its sounds quite difficult, I will try to do it. I am new to this world of programming.

    • @abm4975
      @abm4975  Před 9 měsíci

      Hey
      I could offer a screenshare. Check my channel about section and join via teams. I will have a look into this.
      Thanks

  • @sarahrahimahothman1838

    Hi, this is a fantastic solution! I solved my issue with this video. Do you know how to store this multiple rows in one row of sharepoint list?

    • @abm4975
      @abm4975  Před rokem

      Hi
      You could add string (variable action step) and use append to string to append all the values. Finally use this string variable to update the row of SharePoint list.
      Thanks

    • @sarahrahimahothman1838
      @sarahrahimahothman1838 Před rokem +1

      @@abm4975 Can you show how to do it? I cannot imagine where to add extra function in the flow. Thanks

    • @abm4975
      @abm4975  Před rokem

      Hi
      If you still need help connect me via teams. Have a look at my channel about section.

  • @MSDQ_Creations
    @MSDQ_Creations Před rokem +1

    In an email, how to extraxt a specific text in between other characters (in a constant email format), example: process - Request Nr. 28753 has been submitted for your review. and i need only the request number.

    • @abm4975
      @abm4975  Před rokem

      Hi Muhammed
      Use the last() and split expression to get the value
      last(split('process - Request Nr. 28753','Nr. '))

  • @jnibur
    @jnibur Před rokem +1

    very nice video...and how to extract a table from outlook email and paste into excel?

    • @abm4975
      @abm4975  Před rokem

      Have a look at this video
      czcams.com/video/i4GHCGMAD88/video.html

  • @srambade123
    @srambade123 Před rokem +1

    Hi, this is awesome solution but i need to take rows instead of columns what i need to do?

    • @abm4975
      @abm4975  Před rokem

      Hi
      Thanks for the support. Is your email body data in a HTML table? If not provide an example of data.

    • @srambade123
      @srambade123 Před rokem +1

      ​@@abm4975
      Yes, it's html table in email body.
      Columns are fixed but rows get added as and when data is updated as per new mail received.

    • @abm4975
      @abm4975  Před rokem

      Hi
      Apologies for the late reply.
      Have a look at this video.
      czcams.com/video/i4GHCGMAD88/video.html
      Thanks

  • @hosyaarchand
    @hosyaarchand Před 6 měsíci +1

    only enter is on working, its taking space but not enter

    • @abm4975
      @abm4975  Před 6 měsíci

      Hi
      It should work for both. I need to see your flow. If you still need help check my channel about section and contact me.
      Thanks

  • @jayashudhaanand1781
    @jayashudhaanand1781 Před 9 měsíci +1

    How to extract email address from subject of an email

    • @abm4975
      @abm4975  Před 9 měsíci

      I need to see a sample format of the subject. Are there any specific patterns in your email subject?
      Thanks

  • @benjaminfoley919
    @benjaminfoley919 Před 2 měsíci +1

    The enter key part doesn't seem to work for me

    • @abm4975
      @abm4975  Před 2 měsíci

      So that means in your email each lines are not recognized as enter keys. Is that email generated by other systems?

    • @benjaminfoley919
      @benjaminfoley919 Před 2 měsíci +1

      @@abm4975 Its an automated email generated by a failing machine. But its structured when the email arrives.

    • @abm4975
      @abm4975  Před měsícem

      I need to see your flow. If you ok for a screenshare then see my About section. Send me an email. Thanks