Generating Bulk Contracts from Spreadsheet Data
Law firms, HR departments, real estate agencies, and service businesses regularly produce hundreds of contracts that share the same structure but differ in client names, dates, amounts, and terms. Manually editing each one is slow and error-prone. Mergram lets you connect a spreadsheet to a contract template and generate all documents at once — each accurately personalized and optionally encrypted.
Prerequisites
Before you begin, gather the following:
- A PDF contract template — either a static PDF with text field positions, or a fillable AcroForm PDF
- A spreadsheet with one row per contract and columns for each variable field
- A free Mergram account
Fillable form fields vs. canvas overlay
If your PDF contract has fillable form fields (AcroForm), Mergram auto-detects them and matches columns by name using fuzzy matching. If your PDF is flat (no form fields), you place text fields on the visual canvas overlay at exact positions where variable data should appear.
Types of Contracts You Can Generate
| Contract Type | Common Fields | Typical Use |
|---|---|---|
| Employment agreements | Employee name, title, salary, start date, department | HR onboarding |
| NDAs | Party names, effective date, duration, jurisdiction | Business partnerships |
| Service agreements | Client name, scope, fee, start/end date | Freelancers, agencies |
| Lease agreements | Tenant name, property address, rent, term dates | Property management |
| Sales contracts | Buyer, seller, item description, price, delivery date | E-commerce, wholesale |
| Vendor agreements | Vendor name, service type, payment terms | Procurement |
Setting Up Your Contract Template
Step 1: Prepare the Base PDF
Create or export your contract as a PDF. You can:
- Design the contract in Word, Google Docs, or LaTeX, then export to PDF
- Use an existing contract template from your legal team
- If the PDF has fillable form fields, Mergram detects them automatically
Use placeholders in the source document
When creating the contract in Word or Google Docs, use bracketed placeholders like [[ClientName]] and [[StartDate]] in the body text. This makes it easy to identify where fields should go when you place them in the Mergram editor.
Step 2: Map Party Information Fields
Upload your spreadsheet and drag columns onto the canvas:
- Party names — Map
ClientName,CompanyName,SignerTitle - Dates — Map
EffectiveDate,StartDate,EndDate - Financial terms — Map
Fee,PaymentTerms,Currency - Descriptions — Map
Scope,ServiceDescription,PropertyAddress
Position each field over the corresponding placeholder in the contract text. Adjust font size and family to match the surrounding body text.
Step 3: Add Signature Lines
Create signature areas in your contract:
- Place
SignerNamefields where the signer’s printed name appears - Add
SignerTitlefields below the name - Leave blank space above for the actual signature — the generated PDF will have room for a wet signature or you can add the PDF to an e-signature workflow afterward
Step 4: Configure Password Protection
For confidential legal documents, add per-contract encryption:
- In the merge dialog, enter a password template
- Use merge fields:
[[ClientName]]-[[ContractID]]or[[LastName]][[LastFourSSN]] - Each generated contract is encrypted with RC4 128-bit using the derived password
Legal compliance
If your contracts contain personally identifiable information (PII) or are subject to regulations (HIPAA, GDPR, industry-specific rules), password protection is a baseline measure. Consult your compliance team for additional requirements like audit logging, retention policies, or document watermarking.
Preparing Your Contract Spreadsheet
Organize your data with one row per contract. Use columns for every variable element:
| ClientName | Company | ContractID | EffectiveDate | Fee | Duration | SignerEmail |
|---|---|---|---|---|---|---|
| Alice Chen | Acme Corp | CTR-2025-001 | 2025-02-01 | $5,000 | 12 months | alice@acme.com |
| Bob Martinez | Globex Inc | CTR-2025-002 | 2025-02-15 | $8,500 | 6 months | bob@globex.com |
| Carol Johnson | Initech | CTR-2025-003 | 2025-03-01 | $3,200 | 3 months | carol@initech.com |
Conditional clauses
For contracts where some clauses apply only to certain clients, put the clause text in a spreadsheet column. Rows where the column is empty produce no text in that position — the field simply renders nothing, effectively removing the clause from that version.
Merging and Distributing
Output Modes
Choose the output format that fits your workflow:
| Mode | Best For | What You Get |
|---|---|---|
| Individual PDFs | Emailing contracts separately | One encrypted PDF per contract, named using your filename template |
| Combined PDF | Internal review or batch printing | All contracts in a single PDF document |
| ZIP archive | Archiving or handing off to another system | Individual PDFs bundled into one downloadable ZIP |
Filename Templates
Set a clear naming convention for individual output:
| Template | Example Output |
|---|---|
Contract_[[ContractID]] | Contract_CTR-2025-001.pdf |
NDA_[[Company]]_[[EffectiveDate]] | NDA_Acme Corp_2025-02-01.pdf |
Lease_[[ClientName]] | Lease_Alice Chen.pdf |
Email Distribution
To send contracts directly to recipients:
- Set up your SMTP configuration in Settings
- After preparing the merge, switch to email campaign mode
- Write your email body — you can use merge fields in the subject and body
- Each recipient receives their personalized, password-protected contract as an attachment
Tips for Contract Generation
- Review the first contract carefully — Generate a single-row preview before running the full batch to catch formatting or data mapping issues
- Keep clause text consistent — Use the same wording across rows to maintain legal consistency
- Test password recovery — Verify that the password template produces passwords recipients can derive from their own data
- Version your templates — Use Mergram’s template versioning to track changes to your contract template over time
- Convert Word to PDF with care — Use “Save as PDF” rather than printing to PDF to preserve hyperlinks and form fields
Common Issues and Troubleshooting
Form fields not detected: Not all PDFs have AcroForm fields. If Mergram doesn’t detect any, your PDF is flat. Use the canvas overlay to place text fields at the correct positions instead.
Text doesn’t match the contract font: By default, Mergram uses the Inter font. Upload a custom font that matches your contract’s body text for a seamless look.
Date formats look wrong: Format dates in your spreadsheet before uploading, or create a dedicated column with dates in the desired display format (e.g., February 1, 2025).
Contracts with variable-length content overlap: If some contracts have longer text that pushes into the next section, consider using a template with more spacing or break the contract into separate pages for variable sections.
Get Started
Upload your contract PDF, prepare your spreadsheet with client data, and map fields in the Mergram editor. Preview the first contract, verify accuracy, then generate the full batch with optional encryption.