If you need to generate a PDF after someone submits a form with Gravity Forms, Gravity Flow has you covered.
Gravity Flow is an add-on for Gravity Forms that allows you to create powerful workflows that are triggered on form submission.
In this video, we’ll take a look at how you can use Gravity Flow to generate a PDF after someone submits a form.
Please note that, to follow along with this video, you will need a Gravity Forms license, Gravity Flow license, and the official PDF Generator extension for Gravity Flow.
Links to purchase all three can be found in the description of the video, as well as in the pinned comment.
You can get started by creating the form that you want to use to generate the PDF file.
For this example, I am going to use the Event Registration template so that the form is already built for us.
The form can be easily customized to your liking.
Once you’re happy with your form, navigate to this form’s settings and select Workflow.
Next, you’ll want to create a Workflow step so that you can configure what actions Gravity Flow will take when the form is submitted, such as generating a PDF.
Select ‘Add New’ and then give your step a descriptive name.
Next, choose PDF as the Step Type.
If needed, you can highlight this step, add conditional logic, and schedule it.
Highlighted steps will stand out in both the workflow inbox and step list, which can help bring attention to important tasks, as well as help organize complex workflows.
Conditional logic allows you to set up rules to control when to execute this workflow.
For instance, I can choose to only perform this step once the user’s payment has been authorized.
The schedule option allows you to set a specific time frame for when this step will trigger, such as waiting 24 hours before sending users an email containing the PDF.
Next, you can use the ‘Template’ box to choose what form fields to include in your PDF, using the standard Gravity Forms merge tags.
The {all_fields} merge tag can be used to easily insert all of the information from the form, however, if you want more control, you can use the merge tags for individual form fields, along with your own custom content, if needed.
Gravity Flow will also add some of its own styling to ensure that the PDF looks nice and easy to read.
Once you have tailored your template to your liking, you’ll want to choose how to deliver the PDF to a user.
Gravity Flow offers two main ways to deliver or access the PDF - attached to an email or through a download link via merge tags.
To attach the PDF to an email, select the ‘Send by email’ box.
You’ll then have the option to configure several settings, including the recipient of the email, the subject line, the ‘From’ name, and the body of the email.
You can even use the ‘Custom File Name’ option to use merge tags to dynamically generate a unique file name for each PDF.
Once you have everything configured, be sure to set the ‘Next Step’ to ‘Workflow Complete’, then select ‘Update Step Settings’ to save everything.
Please note that if you choose to send the PDF via email attachment, the file will be deleted from your server once the email is sent.
If you want to keep a version of the PDF on your server, it would be a better option to simply include the download link in the body of an email, rather than attaching the file itself.
Download links can be used anywhere that accepts Gravity Forms merge tags, but the two most common spots are in the confirmation message that displays on your website, or within a notification email that can be sent to users upon form submission.
To give users the ability to download the PDF, you have a choice between two merge tags that can be used: {workflow_pdf_download_link} and {workflow_pdf_download_url}.
The download link merge tag inserts a clickable download link, along with some additional options for controlling access.
The download URL merge tag inserts just the raw URL of the PDF file on your server.
For example, you could use this merge tag if you want to design a custom button instead of just showing a raw link.
When using the download link merge tag, you can use the following optional attributes: ‘text’, ‘signed’, and ‘expires’.
The ‘text’ attribute allows you to customize the link text that is displayed; the default text is ‘Download PDF’.
The ‘signed’ attribute, when enabled, will override any permissions checks for letting the user download the PDF.
The ‘expires’ attribute requires the signed attribute and will expire the link after a certain time.
If you need to construct a download link without using merge tags, simply use the template that is on screen now.
Be sure to replace the ID number with the actual ID of the form entry for which you want to download the PDF.
And that’s all there is to it. Now, whenever a user submits a form, they will be able to access and download a PDF containing the form data.
From everyone on the Gravity Flow team, thanks for watching!
Summary
Gravity Flow gives you the power to generate a PDF whenever a user submits a form. In this video, we’ll walk you through everything you need to know to use Gravity Flow to generate a PDF upon form submission.