Images in HTML Template

Intenta eliminando y recreando ese format rule. Parece ser un BUG. No debería insertarse una imágen sino indicar el link al no usar un IMG

1 Like

Ya lo intenté pero el bug continua

Solo quedaría reportar al equipo de soporte

Have you found a solution? I’m having the same issue. My code:

<b>Melding:</b>
  <blockquote style="margin: 0 20px;">
    <p>Volledig adres:<br><<[Full address]>></p>
    <p>Situatie:<br><<[Related Meldings][Situatie]>></p>
    <p><<Start:[Related Foto situaties]>></p>
    <img src="<<[Foto]>>" style="width: 200px; height: auto;">
    <p><<End>></p>
    <p>Maatregel:<br><<[Related Meldings][Maatregel]>><br><<Start:[Related Foto maatregels]>><<[Foto]>><<End>></p>
    <p>Communicatie:<br><<[Related Meldings][Communicatie]>></p>
  </blockquote>

Everything works fine but it won’t insert the image. The image column is formatted as TEXT, via a format rule.

When I paste the link that is returned from “<<Start:[Related Foto situaties]>><<[Foto]>><>”, into the “<img src=” it does work fine.

On another note, how come I don’t need “<<” everywhere for the html template to work?

My workaround for now is:

<p>Maatregel:<br><<[Related Meldings][Maatregel]>><br>
    <<Start:[Related Foto maatregels]>>
    <a href="<<[Foto]>>" target="_blank">Foto maatregel</a>
    <<End>></p>

Where I make a hyperlink from the image column. Apparently the ‘<<[Foto]>>’ syntax does work within href, while it doesn’t in src.

I haven’t played with HTML images in a long time, but checking one of my old apps I found that the last syntax I used was the following

<style>
 .flex-center {
    align-items: center;
    display: flex;
    justify-content: center;
    width: 100%;
  }
</style>
<body>
<div class="flex-center"> <<[Imagen]>> </div>
</body> 

apparently it works well

What do you mean?

Is your template a .html or .txt?

Thanks for your response, and sorry for my unclear explanation.

I’m using an .html filetype. So I noticed I didn’t need the encoded brackets i.e. “<<” instead of “<<”. But then when I went to insert the “<<[column]>>” brackets into an tag, Appsheet gave an error. So I assumed I did have to use the encoded brackets inside an tag. Which also didn’t work.

When using the “<<[column]>>” syntax inside the tag, Appsheet gave the following error message:

“Error encountered in step with name [Send an email]: Error: Task ‘Send an email’ Body template. Expression ‘[Foto]/’ is invalid due to: Expression ‘[Foto]/’ was unable to be parsed: Expression ‘[Foto]/’ does not match the expected format of an AppSheet expression.”

Apparently Appsheet thinks there is a ‘/’ after my column, while there isn’t.

So now for me I can’t get it to work to insert images directly in the output of my template. Therefore I use the hyperlink approach. Which does work with the “<<[column]>>” brackets inside a <> tag.

Let see, you are saying that you use <<>> instead of the HTML entities for it and it works fine in other places but the IMG tag? Because I would call that a bug by it’s own.

What I have seen is that sometimes html on GDrive behave weird, same with using HTML code inside the “Body” section of a bot. Just curious, have you edited your HTML directly through GDrive? As if it were a text file I mean. If that’s the case, I think it is messing with the way AppSheet parses the template

Yes exactly, everywhere in my HTML template (filetype .html) I can use the <<>> brackets, except in the tag. Than Appsheet registers an extra ‘/’ between the <<>> brackets. This behaviour doesn’t show between the tags.

So what doesn’t work:

<img src="<<[Foto]>>" style="width: 200px; height: auto;">

And what does work:

<a href="<<[Foto]>>" target="_blank"> Foto</a>

No, I’ve uploaded a .html file made in VS Code, to Gdrive. Further no edits through Gdrive.

Have you tried changing all your <<>> to it’s entities? That may also confuse the parser IMO, worth a try.

I always use the right syntax and literally I have never seen an issue with my IMG tags

When I use the “<<” entities everywhere, Appsheet doesn’t fill them in. It shows in the generated email: “<<[column]>>” without actually inserting the column value. Same for formulas, it shows the actual formula with brackets and all, without performing the calculation.

1 Like