How to dynamically pull data into PDF

Is there anything that can help explain how to pass object data across forms and then pull it into the PDF at the end? The documentation does good about showing the pieces, but I am having a hard time putting it all together in a flow. If there is anything, even an example I can import could be helpful so I can just walk through it and replicate. I still think something isn’t clicking when it comes to data and pull it into the PDF “data to fill” piece.

Hey Cam, great question! So there are a few parts to connecting it all of the pieces together.

  1. Making sure the PDF form is prepared properly so that the data operation can fill it. I use Adobe Acrobat and use the “Prepare Form” in the toolbar to do this. This helps with figuring out what form fields are available to fill. Otherwise, you can use the HTML to PDF data operation as well.

  2. The variables bindings on your input boxes that are set on your web flow must be passed to your data flow.

  3. Your data flow has to include the proper input variables and the fill pdf data operation has to be setup to fill your pdf.

Here’s a video of myself walking through a simple fill PDF build.

I’ve also exported a simple example that i hope is useful below:

Exported App:
PDF_Upload-2022-06-23T15_24_22.833Z-full.branch.zip (49.9 KB)
Example prepared PDF:
PDF Fill - example.pdf (34.9 KB)

2 Likes

Just in case you’re having trouble getting data all the way through to the PDF fill step, here are some suggestions:

I’m guessing you’re using variables that are scoped per web page / flow - is that right?

What I would recommend is creating an object that will contain all the data at the session level. That will allow you to append responses from each page along the journey.

Something like this
{“submission”:
{“contact_info”: {“name”: “bob", “phone”:“2125550100”},
{“page_2”: {“item_1”: “test”} and so on
}

I’d recommend setting up an object in AirData that corresponds to this structure. That way when the session starts, you can just create an empty Submission and update it along the way.

@ismaen anything you’d add? That’s how I usually handle multi-page forms, but I’m always looking for a better way!

3 Likes

@ian yeah essentially updating that session level variable is one way. Or you can alternatively change the variable bindings on the inputs to a session level variable of your object type as well.