Generate one Word doc with multiple tables iterating through the same template?

I’m working on a workflow that is triggered by an automation in Notion that passes multiple pages, each of which has a spreadhseet linked. The number of pages (and hence spreadsheets) is variable, selected by the user before triggering the automation.

The ideal outcome of the workflow should be a word document that lists all the tables with a block of text in between each of them with some additional fields from the notion pages.

Looking at the documentation Microsoft Word Templates - Apps Documentation it looks like you can loop through the values of an array to populate a table, but it does not seem possible to create a variable amount of tables in the same template.

I am able to build the content in HTML, but then I need a paid module to convert the HTML to Word. Is there any way to use the Word template the way I want? Any other alternative to convert the HTML to Doc for free?

Thanks!


I want this (yes rows are closed) I want sub rows not as bold and indent

I am trying to figure it out