Document Generation
Formulr allows you to automatically generate PDF documents from collected data.
Principle
- Create a template with variables
- Variables are replaced with actual data
- A PDF is generated instantly
Create a Template
Access Templates
- Open your campaign
- Go to the Documents tab
- Click New template
Choose Editing Mode
| Mode | For Whom | Advantages |
|---|---|---|
| WYSIWYG | Everyone | Visual, simple |
| Liquid | Developers | Flexible, powerful |
Available Variables
Response Data
All values entered in the form:
liquid
{{ campaignResponse.responses.module_name.value[0] }}Campaign Information
liquid
{{ campaign.title }}
{{ campaign.description }}User Information
liquid
{{ campaignResponse.user.firstName }}
{{ campaignResponse.user.lastName }}
{{ campaignResponse.user.email }}Dates
liquid
{{ "now" | date: "%m/%d/%Y" }}
{{ campaignResponse.createdAt | date: "%B %d, %Y" }}Company Logo
liquid
<img src="{{ company_logo }}" alt="Logo" style="max-height: 50px;">Generate a Document
Manually
- Open the response details
- Click Generate a document
- Select the template
- The PDF displays / downloads
Automatically
Via workflows, trigger generation:
- At step completion
- On status change
- Based on a condition
Multi-language
Localized Templates
Create one template version per language:
- Create the template in French
- Change the language in the selector
- Adapt the content
Automatic Selection
The template in the response language is used automatically.
Preview
Before finalizing:
- Select an existing response
- Click Preview
- Check the rendering
Advice
Test with multiple responses to validate all cases (empty fields, long texts...).
Best Practices
Layout
- Use inline styles for compatibility
- Plan margins for printing
- Test rendering with different data sizes
Handling Empty Values
liquid
{% if campaignResponse.responses.phone.value[0] %}
Tel: {{ campaignResponse.responses.phone.value[0] }}
{% endif %}Data Tables
For table modules:
liquid
{% for row in campaignResponse.responses.products.value %}
<tr>
<td>{{ row.name }}</td>
<td>{{ row.quantity }}</td>
</tr>
{% endfor %}Storage and Archiving
Generated documents are:
- Securely stored
- Associated with the response
- Downloadable at any time
- Archived according to your retention policy
Next Steps
- PDF Templates - Detailed syntax
- Electronic Signature - Sign documents
- Workflows - Automate generation