Editing HTML form

What I’m trying to do:

I’ve made a custom HTML Form that is a fairly simple table. Ultimately I’d like to use the form and then insert various data that has been collected in the rest of the app. Then I wanted to submit the form into a Microsoft Teams post which can use the HTML to make a pretty post.

Is it possible to use HTML to grab those data points from the python code? Or should I just construct the html table in python and then display that in some way?

What I’ve tried and what’s not working:

Haven’t really tried anything yet, was just hoping for some guidance on what was considered the optimal way of proceeding.

The Table:

<center style="font-style:italic; color:#888; margin: 3em;">
<table border="1" style="height: 114px;">
<thead>
<tr style="height: 21px;">
<th style="padding: 5px; text-align: center; height: 20px;">Action</th>
<th style="padding: 5px; text-align: center; height: 20px;">ID</th>
<th style="padding: 5px; text-align: center; height: 20px;">Name</th>
<th style="padding: 5px; text-align: center; height: 20px;">Comm. Status</th>
<th style="padding: 5px; text-align: center; height: 20px;">Carrier</th>
<th style="padding: 5px; text-align: center; height: 20px;">Date</th>
<th style="padding: 5px; text-align: center; height: 20px;">PGE Rep.</th>
<th style="padding: 5px; text-align: center; height: 20px;">WWG Rep.</th>
<th style="padding: 5px; text-align: center; height: 20px;">Resolved?</th>
</tr>
</thead>
<tbody>
<tr style="height: 31px;">
<td style="padding: 5px; height: 20px;">Station Repair</td>
<td style="padding: 5px; height: 20px;">
<p><a href="">MW</a> - <a href="">WWG</a></p>
</td>
<td style="padding: 5px; height: 20px;"></td>
<td style="padding: 5px; height: 20px;"></td>
<td style="padding: 5px; height: 20px;"></td>
<td style="padding: 5px; height: 20px;"></td>
<td style="padding: 5px; height: 20px;"></td>
<td style="padding: 5px; height: 20px;"></td>
<td style="padding: 5px; height: 20px;"></td>
</tr>
<tr>
<td style="padding: 5px; height: 20px;"><strong>Actions:</strong></td>
<td style="padding: 5px; height: 20px;" colspan="8"></td>
</tr>
<tr>
<td style="padding: 5px; height: 20px;"><strong>Ticket:</strong></td>
<td style="padding: 5px; height: 20px;" colspan="8"></td>
</tbody>
</table>
</center>

Ahh seemed to miss the portion of the docs that has slots inserted from html here: Anvil Docs | Custom HTML Templates.

That definitely seems like the solution and then on the init to set the self.slot.text to whatever it needs to be.

2 Likes