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

Community site session details

Session Id : jPHNFijUASdFdLar5ztIvi
Power Automate - Building Flows
Answered

Parsing an incoming email

Like (0) ShareShare
ReportReport
Posted on 8 Dec 2023 09:10:04 by 24

Hi

is there an innate limit to the scope while parsing?

I've seen others with more vales, but i can't understand why it's limited.

im having an email with 15 lines and only 14 get parsed - frustrating, because the 15th line is the most important!

thats the "DATA REQUEST" in the code comment.
Greetings

 

here is the html code

 

 

"Content": " <p>
 <html lang=\"en-DE\" style=\"font-size:14px; font-weight:400; line-height:20px; text-transform:initial; letter-spacing:initial; color:#202223; margin:0; padding:0\">
 <head>\r\n
 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
 <meta name=\"viewport\" content=\"user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1\">
 <meta name=\"referrer\" content=\"never\">
 <style data-premailer=\"ignore\">
 \r\n < !--\r\n.apple-link a\r\n\t {
 color: inherit !important;
 \r\n\ttext-decoration: none !important
 }

 \r\n@media screen and (max-width: 534px) {
 \r\n.mail-body>tbody>tr>td\r\n\t {
 padding-top: 0 !important
 }

 \r\n.mail-body__content>tbody>tr>td\r\n\t {
 border-radius: 0;
 \r\n\tborder-top: 0 !important;
 \r\n\tborder-right: 0 !important;
 \r\n\tborder-left: 0 !important
 }

 \r\n.mail-section>tbody>tr>td:first-child\r\n\t {
 padding-left: 20px !important
 }

 \r\n.mail-section>tbody>tr>td:last-child\r\n\t {
 padding-right: 20px !important
 }

 \r\n.mail-help-center>tbody>tr>td:first-child\r\n\t {
 padding-left: 20px !important
 }

 \r\n.mail-help-center>tbody>tr>td:last-child\r\n\t {
 padding-right: 20px !important
 }

 \r\n\r\n\t
 }

 \r\n-->\r\n
 </style>
 <style>
 \r\n < !--\r\nbody\r\n\t {
 margin: 0 !important;
 \r\n\tpadding: 0
 }

 \r\nbody\r\n\t {
 height: 100%;
 \r\n\twidth: 100%
 }

 \r\nimg\r\n\t {
 border: 0;
 \r\n\theight: auto;
 \r\n\tline-height: 0;
 \r\n\toutline: none;
 \r\n\ttext-decoration: none;
 \r\n\tvertical-align: top
 }

 \r\n.ReadMsgBody\r\n\t {
 width: 100%
 }

 \r\n.ExternalClass\r\n\t {
 width: 100%
 }

 \r\n.ExternalClass\r\n\t {
 line-height: 100%
 }

 \r\nbody\r\n\t {}

 \r\nbody\r\n\t {
 font-size: 14px;
 \r\n\tfont-weight: 400;
 \r\n\tline-height: 20px;
 \r\n\ttext-transform: initial;
 \r\n\tletter-spacing: initial;
 \r\n\tcolor: #202223
 }

 \r\na:hover\r\n\t {
 text-decoration: none
 }

 \r\na:active\r\n\t {
 text-decoration: none
 }

 \r\na:visited\r\n\t {
 text-decoration: none
 }

 \r\n@media (max-width: 534px) {
 \r\n.mail-body__content\r\n\t {
 padding: 0 !important;
 \r\n\tborder-left: 0 !important;
 \r\n\tborder-right: 0 !important;
 \r\n\tborder-top: none !important;
 \r\n\tborder-radius: 0 !important;
 \r\n\twidth: 100% !important;
 \r\n\tmax-width: none !important;
 \r\n\tmargin-top: 0 !important
 }

 \r\n.container.section\r\n\t {
 margin-top: 16px !important
 }

 \r\n.banner-container\r\n\t {
 margin-top: 8px !important
 }

 \r\n.main-action-cell\r\n\t {
 float: none !important;
 \r\n\tmargin-right: 0 !important
 }

 \r\n.secondary-action-cell\r\n\t {
 text-align: center;
 \r\n\twidth: 100%
 }

 \r\n.row.content\r\n\t {
 width: 100% !important;
 \r\n\tpadding: 20px !important
 }

 \r\n.customer-info__item\r\n\t {
 display: block;
 \r\n\twidth: 100% !important
 }

 \r\n.subtotal-spacer\r\n\t {
 display: none
 }

 \r\n.banner-alert__table\r\n\t {
 margin-top: 16px !important;
 \r\n\tmargin-bottom: 16px !important
 }

 \r\n\r\n\t
 }

 \r\n-->\r\n
 </style>
 </head>
 <body style=\"height:100%; width:100%; font-size:14px; font-weight:400; line-height:20px; text-transform:initial; letter-spacing:initial; color:#202223; margin:0; padding:0\">
 <table class=\"mail-body\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%; border-collapse:collapse; border-spacing:0; margin-top:0; margin-bottom:0; padding:0\">
 <tbody>
 <tr style=\"margin-top:0; margin-bottom:0; padding:0\">
 <td style=\"margin-top:0; margin-bottom:0; padding:0; border-width:0\"></td>
 <td style=\"margin-top:0; margin-bottom:0; padding:0; border-width:0\">
 <table class=\"mail-body__content\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%; border-collapse:initial; border-spacing:0; max-width:470px; text-align:left; border-radius:8px; overflow:hidden; margin:32px auto 0; padding:0; border:1px solid #c9cccf\">
 <tbody>
 <tr style=\"margin-top:0; margin-bottom:0; padding:0\">
 <td style=\"margin-top:0; margin-bottom:0; padding:0; border-width:0\">
 <table class=\"mail-sections\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%; border-collapse:collapse; border-spacing:0; margin-top:0; margin-bottom:0; padding:0\">
 <tbody>
 <tr style=\"margin-top:0; margin-bottom:0; padding:0\">
 <td style=\"margin-top:0; margin-bottom:0; padding:20px; border-width:0\">
 <table class=\"mail-section mail-section--type-primary\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%; border-collapse:collapse; border-spacing:0; margin-top:0; margin-bottom:0; padding:0\">
 <tbody>
 <tr style=\"margin-top:0; margin-bottom:0; padding:0\">
 <td style=\"margin-top:0; margin-bottom:0; padding:0 0 20px; border-width:0\">
 <table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%; border-collapse:collapse; border-spacing:0; margin-top:0; margin-bottom:0; padding:0\">
 <tbody>
 <tr style=\"margin-top:0; margin-bottom:0; padding:0\">
 <td style=\"margin-top:0; margin-bottom:0; padding:0; border-width:0\">
 <div class=\"primary-message\">You received a new message from your online store's contact form.</div>
 </td>
 </tr>
 </tbody>
 </table>
 </td>
 </tr>
 </tbody>
 </table>
 <table class=\"mail-section\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%; border-collapse:collapse; border-spacing:0; margin-top:0; margin-bottom:0; padding:0\">
 <tbody>
 <tr style=\"margin-top:0; margin-bottom:0; border-top-width:1px; border-top-color:#c9cccf; border-top-style:solid; padding:0\">
 <td style=\"margin-top:0; margin-bottom:0; padding:20px 0 0; border-width:0\">
 <div class=\"form-section\">
 <b>Country Code:</b>
 <pre style=\"font-size:14px; font-weight:400; line-height:20px; text-transform:initial; letter-spacing:initial; color:#202223; margin-top:0; margin-bottom:0; white-space:pre-line; padding:0\">DATA COUNTRY</pre>
 </div>
 <div class=\"form-section\" style=\"margin-top:8px\">
 <b>Translation Missing: En.Templates.Contact.Form.Name:</b>
 <pre style=\"font-size:14px; font-weight:400; line-height:20px; text-transform:initial; letter-spacing:initial; color:#202223; margin-top:0; margin-bottom:0; white-space:pre-line; padding:0\">DATA NAME</pre>
 </div>
 <div class=\"form-section\" style=\"margin-top:8px\">
 <b>Email:</b>
 <pre style=\"font-size:14px; font-weight:400; line-height:20px; text-transform:initial; letter-spacing:initial; color:#202223; margin-top:0; margin-bottom:0; white-space:pre-line; padding:0\">DATA EMAIL</pre>
 </div>
 <div class=\"form-section\" style=\"margin-top:8px\">
 <b>Translation Missing: En.Templates.Contact.Form.Comment:</b>
 <pre style=\"font-size:14px; font-weight:400; line-height:20px; text-transform:initial; letter-spacing:initial; color:#202223; margin-top:0; margin-bottom:0; white-space:pre-line; padding:0\">DATA REQUEST</pre>
 </div>
 </td>
 </tr>
 </tbody>
 </table>
 </td>
 </tr>
 </tbody>
 </table>
 </td>
 </tr>
 </tbody>
 </table>
 </td>
 <td style=\"margin-top:0; margin-bottom:0; padding:0; border-width:0\"></td>
 </tr>
 </tbody>
 </table>
 </body>
 </html>
 </p>"

 

 

 

  • grantjenkins Profile Picture
    11,059 Moderator on 18 Dec 2023 at 09:34:15
    Re: Parsing an incoming email

    You can add a Filter array directly after your Html to text action with the following expressions to retrieve the fields and remove any empty lines.

    //From
    split(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'))
    
    //Condition
    trim(item())

    grantjenkins_0-1702891926354.png

     

    This would give you the following output.

    [
     "Country Code:",
     "DATA COUNTRY",
     "Translation Missing: En.Templates.Contact.Form.Name:",
     "DATA NAME",
     "Email:",
     "DATA EMAIL",
     "Translation Missing: En.Templates.Contact.Form.Comment:",
     "DATA REQUEST"
    ]

    grantjenkins_1-1702891988483.png

     

    Not sure what you want to do with the data after this.

  • roland1112 Profile Picture
    24 on 16 Dec 2023 at 11:50:42
    Re: Parsing an incoming email

    its working!

    is there a way to show how the code gets interpreted e.g. where are the linebreaks etc. because the raw output is a single line. 

    alternative question -  how do i best use the inbuild tools eg. trim etc to find my fields?

  • roland1112 Profile Picture
    24 on 16 Dec 2023 at 11:38:13
    Re: Parsing an incoming email

    ill try it!

  • Verified answer
    VictorIvanidze Profile Picture
    12,538 on 16 Dec 2023 at 11:36:53
    Re: Parsing an incoming email

    Just don't use the "Body preview". Use the real body.

  • roland1112 Profile Picture
    24 on 16 Dec 2023 at 10:40:37
    Re: Parsing an incoming email

    thats my process. 

    roland1112_1-1702723232251.png

     

  • VictorIvanidze Profile Picture
    12,538 on 08 Dec 2023 at 10:35:15
    Re: Parsing an incoming email

    How do you parse it?

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete