In looking at this great resource linked to by Retool it seems to do exactly what I am looking for: take a table of data and populate it into a PDF template and generate the PDF.
Creating PDFs in Retool with APItemplate.io
However I'm getting stuck on just building out the process to pass information to APItemplate.io. Fairly new to everything in Retool but I'll do my best to explain...
I have a query in Retool that contains information on all our survey specifications including the specification table name within the database. So if you click on Survey #1 and the name of that table in the database is survey_1 the query below called selectedSpecExport looks like this:
select * from "spec".{{ variable0 }}
would be...
select * from "spec".survey_1
And it contains the columns I need to pass along to the PDF:
question_id, question_text, construct
This query will populate a table within Retool just fine.
From here, it all falls apart. The guide above while helpful sort of skips over some things or doesn't provide clarity for my use case. In their example they appear to just be pulling a value from a component named {{companyAddress.value}} and assigning it as the value for the company_address key passed via JSON. That seems easy enough but there are dozens of rows that are generated via the query above and in trying to place values into the key pairs it says it cannot find the resource or throws any # of errors, none of which really make sense to me. I think the problem is that I am unsure how to reference the columns in that query to pass along via JSON and it's made more complicated because it's really table/array I am passing with multiple rows, not a single value typed into a component like in the example linked to above.
Hopefully that's not too confusing but the basic gist is that I need to take the data from a query in a Retool application and pass each row from that query on to Apitemplate.io so it will generate a PDF that contains all of the data from that query.
Any help or pointing me in the right direction would be much appreciated!