Fill From JSON
Fills PDF form fields with values from a JSON file, enabling automated form completion for RPA workflows.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- JSON Path - Path to the JSON file containing form field values to fill.
- Source PDF Path - Path to the PDF file with form fields to be filled.
- PDF Path to Save - Output path where the filled PDF file will be saved.
Options
This node does not have any configurable options.
Output
This node does not produce any output variables. The result is saved to the specified PDF file.
How It Works
The Fill From JSON node populates PDF form fields with data from a JSON file. When executed, the node:
- Validates all input file paths
- Reads the JSON file containing field names and values
- Opens the source PDF file
- Matches JSON keys with PDF form field names
- Fills matching form fields with values from the JSON
- Saves the completed form to the output path
Use Cases
- Automated Form Filling: Fill multiple PDF forms with data from a database or API
- Batch Processing: Fill hundreds of forms with different data automatically
- Data Restoration: Restore previously exported form data to a PDF
- Template Population: Fill PDF templates with dynamic data
- Document Generation: Create personalized documents from templates
Example Workflow
Basic Form Filling
- Store customer data in JSON format
- Use Fill From JSON to populate a PDF form template
- Save the completed form with a unique filename
- Email the filled form to the customer
Bulk Processing
- Query database and convert results to JSON
- Loop through each JSON record
- Fill the same PDF template for each record
- Generate multiple personalized PDFs
JSON Format
The JSON file should contain field names as keys and their values:
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "555-1234",
"address": "123 Main St",
"agreeToTerms": true,
"country": "USA"
}
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid JSON path
- JSON file not found or invalid JSON format
- Empty or invalid source PDF path
- Source PDF file not found
- Empty or invalid output PDF path
- PDF file is encrypted or password-protected
- PDF file does not contain fillable form fields
- Insufficient permissions to read source files or write output file
Usage Notes
- Field names in the JSON must exactly match PDF form field names (case-sensitive)
- JSON keys that don't match any PDF field are ignored
- PDF fields not present in the JSON remain unchanged
- Boolean values in JSON can be used for checkboxes (true/false)
- String values are used for text fields
- The source PDF file remains unchanged; only the output file is created
- The output directory must exist before saving the filled PDF
- For encrypted PDFs, decrypt the file first using the Decrypt node
- You can use Export To JSON first to discover the exact field names in a PDF form
Tips for Effective Use
- Field Name Discovery: Use Export To JSON on your template to get exact field names
- Data Validation: Validate JSON data before filling to ensure correct types
- Error Recovery: Enable Continue On Error when processing multiple forms
- Naming Convention: Use descriptive output filenames like
filled_form_${customerId}.pdf - Testing: Test with a sample form first to verify field mapping