Tutorials

Fill Dynamic templates over API

Filling dynamic templates over API is pretty much the same as filling standardized templates. You will submit your data payload to a unique Anvil URL. The key difference being that dynamic templates support clauses, which can be enabled or disabled to create seamless documents that flow around the enabled clauses.

In this article, we’ll mainly focus on how to enable and disable clauses since this is a feature that is unique to dynamic templates. Please see our other articles to learn more about how to set up standardized templates and how to fill standard templates over API. .

Back to Help Center

Getting started

Before you start, you’ll need to create a dynamic template first. As part of this process, you’ll add your clauses and fields, which will automatically be assigned aliases. It’s important to make sure you’re able to identify clauses and fields based on their aliases.

During the fill process, you’ll control clauses and fill fields by matching data values to their respective aliases. While aliases are technically optional, they make it much easier for you to identify which clause or field you’re trying to pass a value to.

You’ll also want to configure the formatting and styling of all text, clauses, and fields. Unlike standardized templates, you can’t adjust text color, size, or other styling properties during the fill process.

Controlling clauses

Once your dynamic template is set up, you can set up your API request to fill your template normally, passing data to all fields that need to be filled.

By default, all clauses are enabled and visible on the resulting document. You can disable clauses individually by passing false to the relevant clause’s alias. Watch the following tutorial to see this process in action:

Additional notes

Dynamic templates do not currently support arrays. This means that neither the repeating PDF nor the repeating PDF pages features are available. If you need to repeat the entire PDF, or specific pages within the PDF, you’ll need to make the fill request with a standardized template instead.

Back to Help Center

Other common posts

1 - 0 of 0

Contact support

We know dealing with tech support can be painful. It's our goal to help you as quickly and efficiently as possible. Once we get your message, we will email you back as soon as we can.
    Want to try Anvil first?