Tutorials

Use conditional logic to dynamically fill PDF fields

Watch the video tutorial to learn how to create selection logic with multiple PDF fields. We'll show you how to dynamically determine:

  • What information is included in your documents
  • Which signer is selected to sign
If you would prefer to use a single PDF field instead, please see examples of complex logic in our advanced JSON editor guide instead.

Back to Help Center

Many forms will ask initial questions that determine what information needs to be returned later down the line.

IF “this particular circumstance”, THEN tell me more about “this specific thing”.

IF “this other circumstance”, THEN tell me about “this other thing” instead.

An example of this would be documents that require both a mailing and billing address. When a unique billing address isn’t available, then the mailing address should be filled out in the billing address section.

Anvil makes it easy to apply selection logic to your PDF fields to automatically fill in the appropriate address in your PDF. We’ll show you how straightforward it is to set this up by leveraging layered PDF fields.

Getting started

Before you start setting up your PDF field logic, add Webform field and page logic first. Webform logic can help you create guided experiences for your customers– ensuring that they’re only asked relevant questions.

Learn how to leverage Webform field and page logic with these articles:

Adding selection logic to your PDF fields

Once you’ve streamlined your Webforms, you’re ready to set up PDF logic to dynamically determine what information fills your PDF.

If you already know how to add PDF field logic, then this tutorial will take you to the next level. We’ll cover additional tips and tricks to help speed up your PDF configuration process:

Additional resources

While this tutorial specifically demonstrates filling in a postal form, you can use the same technique with any of your documents to dynamically determine what information fills specific fields and which signer should sign.

If what you’re trying to accomplish is more complex and you’re stacking an unruly number of PDF fields, we recommend checking out the complex logic examples included in our JSON editor guide instead.

Our JSON editor allows you to encode complex logic with JavaScript expressions, like mapping an entire list of keys to return specific preset values. This will allow you to use a single PDF field rather than stacking multiple fields.

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?
    Sign up for free or try it now with any document.