Ahh so are you are talking about a two step process? First step is to cycle through the set of rows in glide to create a JSON output with all the data to be sent to the pdf writer?
And then second step to send the json to the report writer for output
But does docs automator have a feature that allows for a repeating template…ahh yes it has a line item feature
So in a way the report would be a few hundred “line items”
So how does one cycle through all the rows building a JSON file?
Yeah, that was my thought.
You can trigger a loop with an app interaction. The app interaction would trigger a “webhook trigger” workflow, you can loop through stuff there.
That is what I usually do, I filter the data in my data view, build the JSON, and the app interaction would send that JSON to generate my PDF.
But does docs automator have a feature that allows for a repeating template…ahh yes it has a line item feature
So in a way the report would be a few hundred “line items”
So how does one cycle through all the rows building a JSON file?
I usually build the JSON object column in the line items level, then on the parent level, you have a relation/query, and a lookup on top of it targetting the JSON object will be what you need.
Thanks Thinh…I understand (I think) at a conceptual level but can you possibly elaborate on how you build the payload column… is it a matter of a computed column like a JSON column ?
I think I need to try to do a very simple thing using the principles you are suggesting…build a JSON with two or three fields…then pass it to docs automater to understand the steps involved
Yeah, that’s basically it. JSON Object on the line item level, then lookup that object on the parent level, and then another JSON Object on the parent level to get all the stuff in, including the lookup.
Ahh ok…but I only have the equivalent of line items …imagine I am just wanting a report like a list of names job titles, current employers and phone and email
I don’t need to do the parent access as it is not like I am printing out invoices or credit notes or debtor statements
I think that’s totally fine as well. You can just aggregate them in the Users table, just a place so you can reference it in the DocsAutomator module.
Thank Thinh when you say aggregate I.n the users table, are we talking on row per line item?
Or is it just a column per line item?
By aggregating, I mean you joined the JSONs from the line items together so it forms an array.