Getting started
This feature needs the AI Pack, which includes Document AI. If you don't see the AI option described below when uploading a template, open your organization's billing page to check whether the AI Pack is on your plan. You can subscribe to it there if not.
It also helps to know what field aliases are. A field alias is your own name for a field. For example, employeeName instead of an Anvil-generated one. Field aliases act like keys. You can send data into Anvil with field aliases and any returned data from Anvil will match the way your system already names things.
Normally you set aliases one field at a time in the template editor. A CSV sets them all at once.
Build your CSV
Create a spreadsheet with one row per field. Anvil reads four columns:
Column | Required | What it does |
|---|---|---|
| Yes | Your name for the field. This is the alias that ends up on the template. |
| No | A plain-English description of the field, used by the AI to recognize it on the document. |
| No | The label shown on the field in the editor. |
| No | The field type. Leave blank to let the AI decide. |
Column names aren't case-sensitive, and any extra columns you add are ignored. It's fine to keep notes, internal IDs, or a schema name alongside your fields in the same file.
Download an example W-4 CSV here, or build your own from scratch:
Field Alias | Description | Name | Type |
|---|---|---|---|
employeeName | The name of the employee or applicant. | Employee Name | fullName |
employeeMailingAddress | The mailing address of the employee. | Employee Mailing Address | usAddress |
employeeSsn | The social security number for the employee. | Employee SSN | ssn |
employeeSig | Employee or applicant signature. | Employee Signature | signature |
employerName | The name of the employer. | Employer Name | shortText |
employerSignature | Employer signature. | Employer Signature | signature |
The Description column is the one that matters most. It’s what the AI compares against the labels it reads on the document, so a specific description gets you a better match. “The name of the employee or applicant” works well; “name” doesn’t give the AI much to go on.
A few rules to keep in mind:
- Save as comma-delimited UTF-8. In Excel, choose CSV UTF-8 (Comma delimited). The plain CSV export can produce a file Anvil can't read, and you'll get an error asking you to re-save it.
- Google Sheets’ Download → CSV is already correct.
- Include a header row, and keep the file under 20 MB.
- Field Alias can contain letters, numbers, and
. @ # $ _ -. Dotted names likeemployee.nameare fine, but spaces aren't.- Rows with a blank or invalid alias are skipped.
- Only certain Type values are supported. A row with any other type is skipped, and that field won't appear on your template. If you're unsure, leave Type blank and let the AI infer it.
- Supported Type values are:
-
shortText longTextdatefullNameemailphoneusAddressssneincheckboxnumberdollarintegerpercentimageFilesignatureinitialsignatureDate
-
- Supported Type values are:
- Don't repeat a Field Alias. If the same alias appears on two rows, only the last one is used.
How to upload the CSV with your PDF
- Navigate to your Document templates dashboard
- Click
+ Create templateand choose Standardized Template. - Upload a file
- Leave the AI field detection option checked
- This is what fins and labels fields in your document. The CSV step only appears while it's on.
- Click Connect a data source
- Select CSV from the dropdown menu
- Upload your
.csvfile- If you pick something that isn't a CSV, you'll be asked to choose a
.csvfile.
- If you pick something that isn't a CSV, you'll be asked to choose a
- Click Use this schema
- The step now reads Data source connected. Click it again any time before uploading if you need to swap the file.
- Upload to create the template
- Document AI takes a moment to analyze the document and apply your aliases.
Check the results
Open the new template in the editor and look at the fields. Fields the AI matched to your CSV will carry your field alias, name, and type; fields it couldn't match keep AI-generated names.
It's normal for the match to be partial. The AI only applies an alias where it's confident, so some fields on the document won't be mapped, and some aliases in your CSV won't be used. Anything left over you can set by hand in the editor, exactly as you would normally.
If a lot of fields went unmatched, the fix is usually in the descriptions rather than the document. Make each Description more specific about what the field is and where it tends to appear, then upload again.
Back to Help Center