DocsAutomator - looking for some API Guidance

Using Docs Automator for the first time, and am struggling a bit with the API.

My template is quite large, and will have something like 200+ replacements, including several sets of line items.

Ideally, I want to pass everything as a single JSON payload, but the Docs Automator API seems unable to deal with complex nested JSON, as far as I can work out.

A simplified example of the data payload I want to send is something like the following:

{
	"section1": {
		"parameter1": "some value",
		"parameter2": "another value"
	},
	"section2": {
		"parameter1": "some value",
		"parameter2": "some other value"
	}
}

And then in my template, I would want to refer to the above like:

{{section1.parameter1}}
{{section1.parameter2}}
{{section2.parameter1}}

and so on…

Does anyone know if the above is doable, or do I just have to bite the bullet and flatten everything out into a long series of key/value pairs?

cc @Rupert

Hi @Darren_Murphy, thanks a lot for giving DocsAutomator a spin! :slight_smile:

Your mentioned nested syntax is indeed not supported by DocsAutomator. There are three different types of placeholders: Regular text, images and line items.

You can define section tags in the template and then define conditions for hiding / showing in the DocsAutomator interface. However, the placeholders used within those sections are just referenced flat in the payload. See docs for sections here: Sections - DocsAutomator

Please share your exact use case and I’ll be able to point you in the right direction, advise how to achieve the scenario with DocsAutomator.

Thank you!

@Rupert thanks for confirming. That’s a shame, may I know if you have any plans to support nested JSON in the future?

Also, a follow up question if you don’t mind.

I’ll have several images to insert into my generated PDF, and each image will have an associated caption. I would want to insert them into a two column table, like the example shown below, and the number of images will be dynamic. I’m guessing I will need to use line_items for this, but I’m not exactly sure how that should look in the template. Do you have an example template in your library that I could refer to, or could you suggest the correct approach?