I believe this is an approach to the same use-case described in this post Dynamically generating HTML table using repeat groups
My approach is to generate the HTML tables outside the form and pass them in via context. The challenge is that the HTML(string) is encasped, I believe, thereby making it rendered as text instead of HTML. I understand it might be a security risk if it exists, but is there a way to allow the string to be rendered as HTML instead of text?
Hi Femi!
Unfortunately, I think the short answer is no, this is not possible. Adding raw HTML (and markdown) to field labels (and notes) works because it gets included in the HTML code that is generated by the server when you upload a form. That HTML document is then loaded into the browser DOM by the app. I guess for this dynamic html to work, we would need some special logic to inject the new custom HTML into the DOM. I think in theory it could be done with a custom Enekto widget, but it is not something we have support for right now.
That being said, I would think you could go a very long way towards getting the functionality you want by hard-coding the HTML framework you want in the form and then injecting the data contents via the contact summary. (Though, I guess your main problem with doing something like a table is knowing how many rows will exist…)