Workflow Email Body HTML Table with Start Expression

I try to use HTML in the Workflow Email Body. The result looks like that:
2X_2_244c0ecb6c8576b89133214ed40b19440f5231eb.png
I have 2 questions:

  1. Even though I set the font to Arial, why does the Table have another font?
  2. How do I get the <<Start>> <<End>> expression to work, so that it does new lines for every new record?

My HTML Code is:

<font face="Arial"><h1>Bestellung</h1><font face="Arial"><table border="1" style="width: 100%; border-collapse: collapse; float: left; border-style: solid;"><tr><td style="width: 15.4087%; background-color: #0069b3;"><span style="color: #ffffff;">Mitarbeiter:</span></td><td style="width: 84.5913%;"><<MitarbeiterVC>></td></tr><tr><td style="width: 15.4087%; background-color: #0069b3;"><span style="color: #ffffff;">Kommission:</span></td><td style="width: 84.5913%;"><<Kommission>></td></tr><tr><td style="width: 15.4087%; background-color: #0069b3;"><span style="color: #ffffff;">Bemerkung:</span></td><td style="width: 84.5913%;"><<Bemerkung>></td></tr></table></font>

<table border="1" style="width: 100%; border-collapse: collapse; float: left; border-style: solid;"><tbody><tr><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Hรคndler</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Artikelnummer</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Artikel</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Anzahl</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Bemerkung</span></strong></td></tr><tr><td style="width: 20%;"><<Start:ORDERBY([Related Bestellungs] , [Hรคndler])>><<Hรคndler>></td><td style="width: 20%;"><<ArtikelNr.>></td><td style="width: 20%;"><<Artikel>></td><td style="width: 20%;"><<Anzahl>></td><td style="width: 20%;"><<Bemerkung>><br><<IFS([Lagerfach] = "Ja" , "Lagerfach anlegen!")>><<End>></td></tr></tbody></table>

<a href='<<CONCATENATE('https://www.appsheet.com/start/893a9bce-fd34-4ecb-a9bb-1d7cc344ae2b#appName=Inventur-38452&amp;page=detail&amp;row=',[Key],'&amp;table=Kommission&amp;view=Kommission_Detail')>>' target='_blank' rel='noopener' title='Bestellung รถffnen'><img src="https://imgplaceholder.com/300x50/0069b3/ffffff?text=Bestellung+%C3%B6ffnen&amp;font-size=30" alt="Bestellung รถffnen" width="300" height="50" caption="false" style="float: left;" /></a>

<a href='<<CONCATENATE('https://script.google.com/a/walk-korntal.de/macros/s/AKfycbzGWNp2f4rC2lyQc2sfjnwTdlJFmNAZRFZcL6w/exec?ID=',[Key],'&amp;Option=erledigt')>>' target="_blank" rel="noopener" title="Bestellung erledigt"><img src="https://imgplaceholder.com/300x50/008F33/ffffff?text=Bestellung+erledigt&amp;font-size=30" alt="Bestellung erledigt" width="300" height="50" caption="false" style="float: left;" /></a></font>
Solved Solved
1 13 1,586
1 ACCEPTED SOLUTION

I would create a Google Doc and then use the Google Docs export feature to save it as an HTML file. That will allow you to see exactly what your HTML should look like.

Do this as follows:

  1. Create a Google Docs file
  2. Go to the Google Docs file menu
  3. Select โ€œDownload asโ€ > "Web page (.html zipped)
  4. Unzipped the resulting file
  5. Open the HTML file to see the Google Doc exported as HTML

That is exactly what AppSheet is doing when you use a Google Doc template.

View solution in original post

13 REPLIES 13

@Phil can you help me?

I can investigate if you provide:

  1. Your account id
  2. The app nme
  3. The workflow rule name
  4. The steps to reproduce the problem

Thank you @Phil for investigating.

Account ID: 651676
appName=Inventur-38452-651676
Rule Name: Bestellung Parent
Please have a look in the Email Body

Hi Fabian,

Your template is not being treated as HTML because it does not start with one of the following values:

<Body <Head or <Html

Make one of these three HTML elements the first thing in your template, and add the matching closing HTML tag at the end of the template.

In an HTML file the value << must be HTML encoded as <<
The value >> must be HTML encoded as >>

There appear to be other problems in your template also because it fails HTML parsing.

You might be better off using a Google Doc template.

Thank you Phil for those points. I will give it another try. My goal is to get a clickable button in the Email Body. This is not possible with a Google Doc Template AFAIK.

What do you mean by this?

Sorry about that.

<< characters must be encoded as an &lt;&lt;
>> characters must be encoded as an &gt;&gt;

@LeventK Do you have any simple HTML Email Body with <> expression that you could share?
Iโ€™m strugglingโ€ฆ

I would create a Google Doc and then use the Google Docs export feature to save it as an HTML file. That will allow you to see exactly what your HTML should look like.

Do this as follows:

  1. Create a Google Docs file
  2. Go to the Google Docs file menu
  3. Select โ€œDownload asโ€ > "Web page (.html zipped)
  4. Unzipped the resulting file
  5. Open the HTML file to see the Google Doc exported as HTML

That is exactly what AppSheet is doing when you use a Google Doc template.

@Phil I did exactly what you said. Then I copied the HTML and pasted it into the Email Body.

Error: Workflow rule 'Bestellung Parent' action 'Action 1' Body template. Template could not be loaded due to exception: The 'meta' start tag on line 1 position 14 does not match the end tag of 'head'. Line 1, position 5323.

I had to delete the <meta content="text/html; charset=UTF-8" http-equiv="content-type"> Part. After that I also needed to change the special character &auml; into โ€œรคโ€ and the &ldquo;Ja&rdquo; into "Ja".

Glad to hear that you got it to work.

@Fabian_Weller Does this part really work for you?

 

<a href='<<CONCATENATE('https://www.appsheet.com/start/893a9bce-fd34-4ecb-a9bb-1d7cc344ae2b#appName=Inventur-38452&amp;page=detail&amp;row=',[Key],'&amp;table=Kommission&amp;view=Kommission_Detail')>>' target='_blank' rel='noopener' title='Bestellung รถffnen'>

 

 I have a similar part in my HTML, but I get an error since I added this part. Any idea why it fails?

 

<p><span>&lt;&lt;[Material].[Bezeichnung]&gt;&gt; (<a href="&lt;&lt;[Material].[Produktkatalog]&gt;&gt;">Produktinfos</a>)</span></p>

 

 <<[Material].[Produktkatalog]>> should give a link.

Error message is quite unhelpful as line 1 position 1001 does not exist in my html:

mika134_0-1712913486607.png

 

Hi @mika134 yes it is still working. This is my HTML code in the field "Email Body".

 

Show More
<html><head><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c13{border-right-style:solid;padding:2.8pt 2.8pt 2.8pt 2.8pt;border-bottom-color:#cccccc;border-top-width:1pt;border-right-width:1pt;border-left-color:#cccccc;vertical-align:bottom;border-right-color:#cccccc;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:96.8pt;border-top-color:#cccccc;border-bottom-style:solid}.c3{border-right-style:solid;padding:2.8pt 2.8pt 2.8pt 2.8pt;border-bottom-color:#cccccc;border-top-width:1pt;border-right-width:1pt;border-left-color:#cccccc;vertical-align:bottom;border-right-color:#cccccc;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:69.8pt;border-top-color:#cccccc;border-bottom-style:solid}.c5{border-right-style:solid;padding:2.8pt 2.8pt 2.8pt 2.8pt;border-bottom-color:#cccccc;border-top-width:1pt;border-right-width:1pt;border-left-color:#cccccc;vertical-align:bottom;border-right-color:#cccccc;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:455.2pt;border-top-color:#cccccc;border-bottom-style:solid}.c1{border-right-style:solid;border-bottom-color:#cccccc;border-top-width:1pt;border-right-width:1pt;border-left-color:#cccccc;vertical-align:bottom;border-right-color:#cccccc;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:168.8pt;border-top-color:#cccccc;border-bottom-style:solid}.c18{border-right-style:solid;border-bottom-color:#cccccc;border-top-width:1pt;border-right-width:1pt;border-left-color:#cccccc;vertical-align:bottom;border-right-color:#cccccc;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:148.5pt;border-top-color:#cccccc;border-bottom-style:solid}.c6{border-right-style:solid;border-bottom-color:#cccccc;border-top-width:1pt;border-right-width:1pt;border-left-color:#cccccc;vertical-align:bottom;border-right-color:#cccccc;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:41.2pt;border-top-color:#cccccc;border-bottom-style:solid}.c22{border-right-style:solid;border-bottom-color:#cccccc;border-top-width:1pt;border-right-width:1pt;border-left-color:#cccccc;vertical-align:bottom;border-right-color:#cccccc;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:525pt;border-top-color:#cccccc;border-bottom-style:solid}.c17{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:26pt;font-family:"Arial";font-style:normal}.c7{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left;height:11pt}.c19{padding-top:0pt;padding-bottom:3pt;line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.c2{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:10pt;font-family:"Arial";font-style:normal}.c14{color:#ffffff;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:10pt;font-family:"Arial";font-style:normal}.c9{color:#ffffff;font-weight:700;text-decoration:none;vertical-align:baseline;font-size:10pt;font-family:"Arial";font-style:normal}.c12{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c15{padding-top:0pt;padding-bottom:0pt;line-height:1.0;orphans:2;widows:2;text-align:right}.c20{margin-left:auto;border-spacing:0;border-collapse:collapse;margin-right:auto}.c0{padding-top:0pt;padding-bottom:0pt;line-height:1.0;text-align:left}.c21{background-color:#ffffff;max-width:538.6pt;padding:28.3pt 28.3pt 28.3pt 28.3pt}.c4{background-color:#0069b3}.c11{height:11pt}.c10{height:0pt}.c16{padding:2.8pt 2.8pt 2.8pt 2.8pt}.c8{height:15pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c21"><p class="c19 title" id="h.j6x82kelyjrm"><span class="c17">Bestellung</span></p>
<br></br>
<p class="c7"><span class="c2"></span></p><a id="t.d6c7f3db321c7b08cc23d35062c7512820cc7c89"></a><a id="t.0"></a><table class="c20"><tbody><tr class="c8"><td class="c3 c4" colspan="1" rowspan="1"><p class="c12"><span class="c14">Mitarbeiter:</span></p></td><td class="c5" colspan="4" rowspan="1"><p class="c12"><span class="c2">&lt;&lt;MitarbeiterVC&gt;&gt;</span></p></td></tr><tr class="c8"><td class="c3 c4" colspan="1" rowspan="1"><p class="c12"><span class="c14">Kommission:</span></p></td><td class="c5" colspan="4" rowspan="1"><p class="c12"><span class="c2">&lt;&lt;Kommission&gt;&gt;</span></p></td></tr><tr class="c8"><td class="c3 c4" colspan="1" rowspan="1"><p class="c12"><span class="c14">Bemerkung:</span></p></td><td class="c5" colspan="4" rowspan="1"><p class="c12"><span class="c2">&lt;&lt;Bemerkung&gt;&gt;</span></p></td></tr><tr class="c10"><td class="c16 c22" colspan="5" rowspan="1"><p class="c0 c11"><span class="c2"></span></p></td></tr><tr class="c10"><td class="c3 c4" colspan="1" rowspan="1"><p class="c0"><span class="c9">Hรคndler</span></p></td><td class="c13 c4" colspan="1" rowspan="1"><p class="c0"><span class="c9">Artikelnummer</span></p></td><td class="c4 c16 c18" colspan="1" rowspan="1"><p class="c0"><span class="c9">Artikel</span></p></td><td class="c6 c4 c16" colspan="1" rowspan="1"><p class="c0"><span class="c9">Anzahl</span></p></td><td class="c1 c4 c16" colspan="1" rowspan="1"><p class="c0"><span class="c9">Bemerkung</span></p></td></tr><tr class="c10"><td class="c3" colspan="1" rowspan="1"><p class="c0"><span class="c2">&lt;&lt;Start:ORDERBY([Related Bestellungs] , [Hรคndler])&gt;&gt;&lt;&lt;Hรคndler&gt;&gt;</span></p></td><td class="c13" colspan="1" rowspan="1"><p class="c0"><span class="c2">&lt;&lt;ArtikelNr.&gt;&gt;</span></p></td><td class="c18 c16" colspan="1" rowspan="1"><p class="c0"><span class="c2">&lt;&lt;Artikel&gt;&gt;</span></p></td><td class="c6 c16" colspan="1" rowspan="1"><p class="c0"><span class="c2">&lt;&lt;Anzahl&gt;&gt;</span></p></td><td class="c1 c16" colspan="1" rowspan="1"><p class="c0"><span class="c2">&lt;&lt;Bemerkung&gt;&gt;</span></p><p class="c0"><span class="c2">&lt;&lt;IFS([Lagerfach] = "Ja" , "Lagerfach anlegen!")&gt;&gt;&lt;&lt;End&gt;&gt;</span></p></td></tr></tbody></table><p class="c7"><span class="c2"></span></p>
<br></br>
<p>
<a href='&lt;&lt;CONCATENATE("https://www.appsheet.com/start/893a9bce-fd34-4ecb-a9bb-1d7cc344ae2b#appName=Inventur-38452&amp;page=...",[Key],"&amp;table=Kommission&amp;view=Kommission_Detail")&gt;&gt;' target="_blank" rel="noopener" title="Bestellung รถffnen"><img src="https://placehold.jp/0069b3/ffffff/300x50.png?text=Bestellung%20%C3%B6ffnen
" alt="Bestellung รถffnen" width="300" height="50" caption="false" style="float: left;" /></a></p>
<p>
<a href='&lt;&lt;CONCATENATE("https://hook.integromat.com/jl7wz7gvamm7hujxk3m65nvwtzj2v69f?Key=",[Key],"&amp;Kommission=",[Kommission],"&amp;Status=TRUE")&gt;&gt;' target="_blank" rel="noopener" title="Bestellung erledigt"><img src="https://placehold.jp/008f33/ffffff/300x50.png?text=Bestellung%20erledigt" alt="Bestellung erledigt" width="300" height="50" caption="false" style="float: left;" /></a></p>
<p></p>
</body></html>

Maybe the problem in your code is the round brackets? I think you should not use them.

(<a href="&lt;&lt;[Material].[Produktkatalog]&gt;&gt;">Produktinfos</a>)

 

Thanks @Fabian_Weller 

I found an easier way, at least for me. I now use the appsheet variable instead.

<<HYPERLINK([Material].[Produktkatalog],"Produktinfos")>>

 

Top Labels in this Space