🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 20, 2026

How to Create Documents From Gravity Forms With Formstack Documents

GravityExtra
How to Create Documents From Gravity Forms With Formstack Documents

Many forms on a website end in a document. A rental application becomes a lease agreement, a booking becomes a confirmation, a quote request becomes a quote, a course registration becomes a certificate. Too often somebody still copies the answers from the notification e-mail into a Word file, saves it as a PDF and sends it by hand. That takes time, and every copied line is a chance for a typo in a name or an amount.

Formstack Documents (formerly WebMerge) solves the template part: it fills Word, PDF, Excel, PowerPoint or HTML templates with data. This guide shows how to connect it to Gravity Forms with the Gravity Forms Formstack Documents Integration Premium Add-on, so every entry creates its document automatically and the finished file comes back to WordPress: on the entry, in the confirmation, in e-mails and in your exports.

The Merge fields section of a Formstack Documents feed in Gravity Forms: the list of fields found in the Lease agreement template and the field mapping table with the merge fields FirstName, LastName, Email, Unit, MonthlyRent, MoveInDate and Occupants matched with the form fields Name (First), Name (Last), Email, Unit, Monthly rent, Move-in date and Occupants, a LeaseNumber merge field filled with the custom value NR-{entry_id}-{Unit:4}, and the option to also send every form field
Form Settings → Formstack Documents: the merge fields of the template, matched with your form fields.

How Gravity Forms and Formstack Documents Work Together

In Formstack Documents you build a template once and mark the places where data goes with merge fields, such as {$FirstName} or {$MonthlyRent}. The add-on reads the list of your documents and their merge fields through the Formstack Documents API, using the API key of your own account. When a form is submitted, it sends the values of the entry to the template you chose. Formstack Documents fills in the template and sends the file back, and the add-on stores it with the entry.

You can use one document per feed, or a data route. A data route is a set of rules in Formstack Documents that picks one or more templates for each entry and can combine them. A typical example is a tenant pack: the lease agreement for every applicant and a pet addendum only for applicants with a pet. Whatever deliveries you have set up in Formstack Documents, such as e-mail, cloud storage or e-signature, keep working too.

Step 1: Connect Your Account

In Formstack Documents, open Settings, API Access and copy the API key and the API secret. In WordPress, go to Forms, Settings, Formstack Documents, paste both and click Test the connection. The add-on shows how many documents and data routes it found. If a key or secret is wrong, the settings are not saved and you see the answer of the API, so you never end up with a broken connection by accident. The secret is shown as dots and is never written to notes or logs.

Running documents for more than one business, or for a second office? Each feed can use another Formstack Documents account with its own key and secret.

Step 2: Choose the Template

Open your form, go to Settings, Formstack Documents and add a feed. Pick the document or data route from the list. The list shows the output type of each document, such as PDF or XLSX, so you can tell a lease agreement from a rent schedule at a glance. As soon as you pick one, the add-on loads the merge fields of that template.

Step 3: Map the Fields Without the Busywork

Here the add-on saves you the most clicks. The first time you save the feed, every merge field of the template gets its own row, already matched with the form field of the same name. Capitals, spaces and punctuation are ignored, so MonthlyRent finds the field “Monthly rent” and FirstName finds the first name of the Name field. You only fill in what is left.

For those, you have a few options. Choose any form field or a part of it, such as the city of an address. Choose entry details such as the entry ID or the date. Or type a custom value that mixes text and merge tags, for example a lease number built from the entry ID and the unit. Repeating data works too: a List field with columns, such as the occupants of an apartment or the items of an order, is sent as rows, so the template can print one line per row. Several uploaded files are sent as a list of links.

Step 4: Test Before You Go Live

Switch on test mode while you build the template. The documents are then made in the test mode of Formstack Documents. You do not even need to fill in the form: click Create a test document now and the add-on uses the latest entry, or sample values for a new form, and shows the result right next to the button, with the file name, the size and the time it took. When the document looks right, switch test mode off. The feed list shows at a glance which feeds are live and which are still in test mode.

Step 5: Decide Where the Finished File Goes

By default the add-on keeps a copy of every document on your site. Files are stored in a protected folder in your uploads, which blocks direct access, and they open through a signed link that works only for that one file. You choose who can open the link: anyone who has it, which is right for the person who filled in the form, or only logged-in users of your team who may view entries.

The Finished document section of a Formstack Documents feed: Keep a copy on this site in a protected uploads folder, who can open the link (anyone with the link or only logged-in users who can view entries), the notifications to attach the file to (Applicant confirmation, Leasing office: lease ready, Leasing office: lease failed) and conditional logic
Keep the file, choose who can open its link and attach it to notifications.

From there the file can travel. Tick any notification of the form to attach the document, for example the confirmation e-mail to the applicant and a copy for your office. Put the merge tag for the document link in a confirmation message, so the visitor can download the lease agreement on the thank-you page. Or use the new notification event “Formstack Documents: document ready”, which is sent the moment the file exists, also when the document was made in the background.

Visitors never wait for the document by default: the form confirms at once and the document is made right after, through the Gravity Forms background queue. When you attach the file to an e-mail that is sent on submission, the add-on makes that document during the submission instead, so the e-mail is never sent without its attachment.

Everything on the Entry

Each document is written as a note on the entry, with the file name, the size, the time it took and whether it was a test. The entry screen gets a Formstack Documents box with every document and its link, and a Generate again button. That is handy when you fix a typo in a template or correct an entry: one click and the new version is there. The latest link is also an entry property, so you can show it as a column in the entry list or include it in a CSV export for your bookkeeping.

A Lease application entry in Gravity Forms with the Formstack Documents box on the right: the feed Lease agreement created the file Lease agreement - Marco Bianchi.pdf of 72 KB and the data route Tenant pack created two files, the lease agreement and a pet addendum, each with a Generate again button, and entry notes that list the files that were created and kept on the site
The entry screen: every document with its link and size, Generate again, and a note for each document.

Paid Forms, Conditions and Several Documents

Selling something with the document? On forms with a payment add-on such as Stripe or PayPal, the add-on can wait for the payment. Tick the option in the payment feed and the contract, ticket or certificate is created only after the payment has been received. Conditional logic decides per feed whether a document is needed at all, and a form can have as many feeds as you like, for example a lease agreement for everybody and a parking permit only when a parking space was requested.

When Something Goes Wrong

Templates get renamed, keys get replaced and services have bad days. The add-on turns every problem into a clear note on the entry instead of a silent failure: a refused key, a document that was deleted in Formstack Documents, data that the service refused, too many requests or no answer in time. The feed is marked as failed for that entry and the notification event “Formstack Documents: document failed” can tell your team straight away, with the reason in the message. Secrets and merge keys are always masked. When the cause is fixed, Generate again on the entry creates the document.

Tips for Better Documents

  • Name merge fields like your form fields. The automatic match then fills the whole map for you.
  • Use admin field labels. With “Also send every form field” the admin label is the merge field name, so it stays the same when you change the label visitors see.
  • Keep test mode on until the template is final. Then switch it off in one place.
  • Use a data route for document packs. One feed then creates the right set of documents for every entry.
  • Limit links for internal documents. Choose “Only logged-in users who can view entries” for documents that are not meant for the visitor.

Frequently Asked Questions

Do I need a Formstack Documents account?

Yes. The add-on uses your own account and API key, and the documents count against your Formstack Documents plan. The add-on itself works with any Gravity Forms licence.

Is WebMerge supported?

Yes. Formstack Documents is the new name of WebMerge, and the add-on uses the same API, so existing WebMerge templates and data routes work as they are.

Does the data pass through another service?

No. The entry goes from your website straight to Formstack Documents and the file comes straight back.

Which versions are supported?

Gravity Forms 2.9 or newer with WordPress 6.5 and PHP 7.4 or newer. The add-on is tested with Gravity Forms 2.9 and 3.1.

Create Documents From Gravity Forms

Fill your Formstack Documents templates with every entry and get the finished file back on the entry, in e-mails and on the confirmation page.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr