Extract simple text from forms submitted to mail as html

Hi all!

I need help with this.

  • Extract text from HMTL in email
  • Have tried tools as text parser and get variable and so on.
  • I need to map the questions/answers, so i can send it as json or send it to monday.com.
    The only thing i need is just a push in the right direction on how to get the text from the mail.

Mail content :

´´´
[
{
“html”: “\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)">\r\n\r\n<body lang="NO-BOK" link="blue" vlink="purple" style="word-wrap:break-word"><div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt"> 

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<p class="MsoNormal"><span style="font-size:11.0pt; color:black">Mathias Kringelen <span style="font-size:11.0pt">

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<div id="mail-editor-reference-message-container">
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt; color:black">Fra: <span style="font-size:12.0pt; color:black">Mathias Kringelen <mathias@kringelen.no>
Dato: mandag, 29. april 2024 kl. 11:38
Til: Mathias Kringelen <mathias@kringelen.no>
Emne: Videresend: Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<p class="MsoNormal"><span style="font-size:11.0pt; color:black">Mathias Kringelen

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<div id="mail-editor-reference-message-container">
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt; color:black">Fra: <span style="font-size:12.0pt; color:black">Mathias Kringelen <mathias@kringelen.no>
Dato: mandag, 29. april 2024 kl. 10:59
Til: Mathias Kringelen <mathias@kringelen.no>
Emne: Videresend: Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<p class="MsoNormal"><span style="font-size:11.0pt; color:black">Mathias Kringelen

<p class="MsoNormal"><span style="font-size:11.0pt"> 

<div id="mail-editor-reference-message-container">
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt; color:black">Fra: <span style="font-size:12.0pt; color:black">Kringelen Maskinservice App <noreply@reports.connecteam.com>
Dato: lørdag, 27. april 2024 kl. 21:47
Til: Mathias Kringelen <mathias@kringelen.no>
Emne: Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita

<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%; border-collapse:collapse"><td valign="top" style="padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="838" style="width:628.5pt; border-collapse:collapse"><td valign="top" style="padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="838" style="width:628.5pt; background:white; border-collapse:collapse"><td valign="top" style="padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="838" style="width:628.5pt; background:white; border-collapse:collapse"><tr style="height:31.5pt"><td style="padding:0cm 0cm 0cm 0cm; height:31.5pt"><p class="MsoNormal"><span style="font-size:11.0pt; color:black"> 

<td valign="top" style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt; color:black"><img height="72" id="_x0000_i1028" src="https://cdn.connecteam.com/email-assets/bookshelf_assets/object_note.png\” style="height:.75in">

<tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt"><p class="MsoNormal"><span style="font-size:11.0pt; color:black"> 

<td valign="top" style="padding:0cm 0cm 0cm 0cm"><div align="center"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal" align="center" style="text-align:center; line-height:19.5pt"><span style="font-size:18.0pt; font-family:Roboto; color:#333333">Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita

<tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt"><p class="MsoNormal"><span style="font-size:1.0pt; color:black"> 

<td valign="top" style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:15.0pt; font-family:Roboto; color:black">View the form entry below, for all other functions <a href="https://6xlgbqw1.r.eu-west-1.awstrack.me/L0/https:%2F%2Fapp.connecteam.com%2Findex.html%23%2Fdeeplink%3Fl=%257B%2522lpid%2522%253A%2522ceb18243-387e-4744-8e80-36d54d3f8e02%2522%252C%2522courseId%2522%253A5445350%252C%2522sectionId%2522%253A5736672%252C%2522contentId%2522%253A%25226418394%2522%252C%2522section%2522%253Anull%252C%2522action%2522%253A%2522openEntry%2522%252C%2522actionParams%2522%253A%257B%2522timestamp%2522%253A%25221714247199%2522%257D%252C%2522tab%2522%253Anull%252C%2522isAppStructureDeepLink%2522%253Atrue%252C%2522forceUserView%2522%253Afalse%252C%2522stateId%2522%253A%252265d8810149f9682883e7ecc5%2522%257D/1/0102018f2118b248-3ae2c1cd-31c3-40e7-8fb5-401b99249692-000000/5WpyM6nCeKctR50To_r3XoDRf28=371\“><span style="color:#2998FF; text-decoration:none">go to dashboard

<tr style="height:24.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:24.0pt"><p class="MsoNormal"><span style="font-size:11.0pt; color:black"> 

<td width="838" style="width:628.5pt; background:#F6F7F7; padding:24.0pt 24.0pt 24.0pt 24.0pt; border-radius:18px"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:0cm 0cm 0cm 0cm"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:.75pt .75pt .75pt .75pt"><p class="MsoNormal"><span style="font-size:11.0pt"> 

<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%; border-collapse:collapse"><tr style="height:30.0pt"><td width="64" style="width:48.0pt; background:#0288D1; padding:0cm 0cm 0cm 0cm; height:30.0pt; min-width:64px; border-radius:50%"><p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:18.0pt; font-family:"Arial",sans-serif; color:white">MB

<td width="16" style="width:12.0pt; padding:0cm 0cm 0cm 0cm; height:30.0pt"><p class="MsoNormal"><span style="font-size:11.0pt"> 

<td width="560" style="width:420.0pt; padding:0cm 0cm 0cm 0cm; height:30.0pt"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal"><span style="font-size:13.5pt">Magnus Rosland Berg-Jensen

<td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal"><span style="font-size:11.0pt">April 27, 2024 at 21:46 | Europe/Oslo

<td width="16" style="width:12.0pt; padding:0cm 0cm 0cm 0cm; height:30.0pt"><p class="MsoNormal"><span style="font-size:11.0pt"> 

<td width="43" style="width:32.25pt; padding:0cm 0cm 0cm 0cm; height:30.0pt"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal"><span style="font-size:13.5pt; color:black; background:white">#7

<td width="16" style="width:12.0pt; padding:0cm 0cm 0cm 0cm; height:30.0pt"><p class="MsoNormal"><span style="font-size:11.0pt"> 

<td width="40" style="width:30.0pt; padding:0cm 0cm 0cm 0cm; height:30.0pt"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal"><a href="https://6xlgbqw1.r.eu-west-1.awstrack.me/L0/https:%2F%2Fs3.eu-central-1.amazonaws.com%2Fonefid.content.assets%2Ftvgdhszaihivgrns%2F6418394%2Fentries%2FRekvisisjon__verkt_y_og_rekvisita_April_27_2024_Magnus_Rosland_Berg_Jensen_7-95d27a82-b9a4-400f-82e7-fd0bc7f95394.pdf/1/0102018f2118b248-3ae2c1cd-31c3-40e7-8fb5-401b99249692-000000/KZeYnpDG3PlufGxDJBj6-6PNntY=371\”><span style="color:windowtext; text-decoration:none"><span style="font-size:11.0pt; color:blue"><img border="0" id="_x0000_i1027" src="https://cdn.connecteam.com/email-assets/bookshelf_assets/download_button.png\" alt="download_btn">

<td style="padding:0cm 0cm 12.0pt 0cm"><td width="775" style="width:581.25pt; background:white; padding:0cm 0cm 0cm 0cm; border-radius:18px"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr style="height:12.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:12.0pt"><td style="padding:0cm 0cm 0cm 12.0pt"><p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:#203040">Hva er det snakk om?

<tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt"><td style="padding:0cm 0cm 0cm 12.0pt; white-space:pre-line"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:#203040">Spett og brekkjern Biltema nr brekkjern: 16-858 Felleskjøp nr spett: 50314033

<tr style="height:12.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:12.0pt"><p class="MsoNormal"><span style="font-size:11.0pt; color:black"> 

<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:.75pt .75pt .75pt .75pt"><tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt"><td width="775" style="width:581.25pt; background:white; padding:0cm 0cm 0cm 0cm; border-radius:18px"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr style="height:12.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:12.0pt"><td style="padding:0cm 0cm 0cm 12.0pt"><p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:#203040">Hva trenger vi det til?

<tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt"><td style="padding:0cm 0cm 0cm 12.0pt; white-space:pre-line"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:#203040">Orkel

<tr style="height:12.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:12.0pt"><p class="MsoNormal"><span style="font-size:11.0pt; color:black"> 

<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:.75pt .75pt .75pt .75pt"><tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt"><td width="775" style="width:581.25pt; background:white; padding:0cm 0cm 0cm 0cm; border-radius:18px"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr style="height:12.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:12.0pt"><td style="padding:0cm 0cm 0cm 12.0pt"><p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:#203040">Hastegrad?

<tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt"><td style="padding:0cm 0cm 0cm 12.0pt; border-radius:9px"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr style="height:27.0pt"><td style="background:#F6F7F7; padding:0cm 0cm 0cm 0cm; height:27.0pt"><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td width="8" style="width:6.0pt; padding:0cm 0cm 0cm 0cm"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal"><span style="font-size:11.0pt"><img border="0" id="_x0000_i1026" src="https://cdn.connecteam.com/email-assets/bookshelf_assets/checkbox-checked.png\" alt="checkbox_icon">

<td width="8" style="width:6.0pt; padding:0cm 0cm 0cm 0cm"><td style="padding:0cm 0cm 0cm 0cm"><p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.5pt; color:#203040">Høy

<td width="8" style="width:6.0pt; padding:0cm 0cm 0cm 0cm"><p class="MsoNormal"><span style="font-size:11.0pt"> 

<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr style="height:12.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:12.0pt"><p class="MsoNormal"><span style="font-size:11.0pt; color:black"> 

<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><td style="padding:.75pt .75pt .75pt .75pt"><tr style="height:6.0pt"><td style="padding:0cm 0cm 0cm 0cm; height:6.0pt">
<tr style="height:52.5pt"><td style="padding:0cm 0cm 0cm 0cm; height:52.5pt"><p class="MsoNormal"><span style="font-size:11.0pt"><img border="0" id="_x0000_i1025" src="https://6xlgbqw1.r.eu-west-1.awstrack.me/I0/0102018f2118b248-3ae2c1cd-31c3-40e7-8fb5-401b99249692-000000/iqV4eDyZXv_n1zaWxREtQ8cu8Xk=371\“></span></p></div></div></div></div></div></div></div></div></div></body></html>”
}
]
´´´

How the mail looks (example) we have several forms, and i just want an idea how to do this.

With Best regards
Mathias

Hi Mathias,
I noticed that the email content is basically an HTML table (because of the various tr and td tags)
As such did you try using the “Get content from HTML table” present in the Text parser module?

2 Likes

I used that one, and it works a bit, but what to do from here ?

[
    {
        "text": "Mathias Kringelen \n\n\n\nFra: Mathias Kringelen <mathias@kringelen.no>\nDato: mandag, 29. april 2024 kl. 11:38\nTil: Mathias Kringelen <mathias@kringelen.no>\nEmne: Videresend: Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita\n\n\n\n\n\nMathias Kringelen \n\n\n\nFra: Mathias Kringelen <mathias@kringelen.no>\nDato: mandag, 29. april 2024 kl. 10:59\nTil: Mathias Kringelen <mathias@kringelen.no>\nEmne: Videresend: Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita\n\n\n\n\n\nMathias Kringelen \n\n\n\nFra: Kringelen Maskinservice App <noreply@reports.connecteam.com>\nDato: lørdag, 27. april 2024 kl. 21:47\nTil: Mathias Kringelen <mathias@kringelen.no>\nEmne: Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita\n\n\n\n[https://cdn.connecteam.com/email-assets/bookshelf_assets/object_note.png]\n\n\n\nMagnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita \n\n \n\nView the form entry below, for all other functions go to dashboard [https://6xlgbqw1.r.eu-west-1.awstrack.me/L0/https:%2F%2Fapp.connecteam.com%2Findex.html%23%2Fdeeplink%3Fl=%257B%2522lpid%2522%253A%2522ceb18243-387e-4744-8e80-36d54d3f8e02%2522%252C%2522courseId%2522%253A5445350%252C%2522sectionId%2522%253A5736672%252C%2522contentId%2522%253A%25226418394%2522%252C%2522section%2522%253Anull%252C%2522action%2522%253A%2522openEntry%2522%252C%2522actionParams%2522%253A%257B%2522timestamp%2522%253A%25221714247199%2522%257D%252C%2522tab%2522%253Anull%252C%2522isAppStructureDeepLink%2522%253Atrue%252C%2522forceUserView%2522%253Afalse%252C%2522stateId%2522%253A%252265d8810149f9682883e7ecc5%2522%257D/1/0102018f2118b248-3ae2c1cd-31c3-40e7-8fb5-401b99249692-000000/5WpyM6nCeKctR50To_r3XoDRf28=371]\n\n\n\n\n\nMB \n\n \n\nMagnus Rosland Berg-Jensen \n\nApril 27, 2024 at 21:46 | Europe/Oslo\n\n\n\n#7 \n\n\n\ndownload_btn [https://cdn.connecteam.com/email-assets/bookshelf_assets/download_button.png] [https://6xlgbqw1.r.eu-west-1.awstrack.me/L0/https:%2F%2Fs3.eu-central-1.amazonaws.com%2Fonefid.content.assets%2Ftvgdhszaihivgrns%2F6418394%2Fentries%2FRekvisisjon__verkt_y_og_rekvisita_April_27_2024_Magnus_Rosland_Berg_Jensen_7-95d27a82-b9a4-400f-82e7-fd0bc7f95394.pdf/1/0102018f2118b248-3ae2c1cd-31c3-40e7-8fb5-401b99249692-000000/KZeYnpDG3PlufGxDJBj6-6PNntY=371]\n\nHva er det snakk om?\n\nSpett og brekkjern Biltema nr brekkjern: 16-858 Felleskjøp nr spett: 50314033\n\n\n\nHva trenger vi det til?\n\nOrkel\n\n\n\nHastegrad?\n\ncheckbox_icon [https://cdn.connecteam.com/email-assets/bookshelf_assets/checkbox-checked.png]\n\nHøy\n\n\n\n\n\n[https://6xlgbqw1.r.eu-west-1.awstrack.me/I0/0102018f2118b248-3ae2c1cd-31c3-40e7-8fb5-401b99249692-000000/iqV4eDyZXv_n1zaWxREtQ8cu8Xk=371]"
    }
]

In this Text i want the following extracted:

Magnus Rosland Berg-Jensen completed Rekvisisjon, verktøy og rekvisita

Hva er det snakk om? (This is a question, and always the same.

Answer: Spett og brekkjern
Biltema nr brekkjern: 16-858 Felleskjøp nr spett: 50314033

Question: Hva trenger vi det til?

Answer: Orkel

Question : Hastegrad?

Checkbox checked=high not checked = low

Now you can create a pattern to match the plain text instead of HTML.

When asking for help with creating a regex pattern for a text parser module, I strongly suggest you do not censor the text that you actually need to match.

Please also do not share screenshots of text (even partial text). Instead, copy and paste the text here as well so that we can run it against test patterns.

If you do not provide proper examples, you could be wasting our time as we have to guess your sample input. Not only that, you may not get the correct answer, or it may take several “guesses”.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

2 Likes

Hi Samliew.
I am not very rutinated yet in the forum.
Thank you for Your understanding, and thank you for once again pointing out what we should do to make it right :blush:

I have edited the post now. Can you please take a look? :blush:

3 Likes

I managed to Get access to the Api to the forms system, so i’m okay
:smiley:

2 Likes

Hey @Mathias_Kringelen :wave:

It’s fantastic to hear that you don’t experience your problem anymore!

Thank you so much for sharing what has worked for you. This way we keep our community neat and organized! :star:

how did you fix it? did you follow the tip given or did you do something else

Hi.
Sorry for my bad response here.

I got access to the Api, so i’m getting it as json instead :blush: