PDF Editing Issues

Automatically Fill Multiple Acrobat Form Fields from One Field

Elise WilliamsElise Williams Nov 19, 2026 868 views

Question details

Populate several PDF form fields using a single document-number field.

Automatically Fill Multiple Acrobat Form Fields from One Field
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form contains a document-number field and related fields for the date, full document name, and summary.
Observed behavior
Entering a document number should fill the related fields with the corresponding information.
Before you start

List the document numbers and their corresponding dates, names, and summaries, or identify a predictable rule for generating them. Open the PDF in Acrobat and check that you can edit its form fields.

Solution 1Recommended

Use custom calculation scripts to fill the related fields

Use this method when each document number has known values or follows a predictable rule.

Each destination field can use a custom calculation script that reads the document-number field and assigns a result to event.value. The example below uses a small lookup table; replace its sample entries with your own data.

1
Create and name the fields

Open the PDF in Acrobat and select All tools > Prepare a form. Create a text field named DocumentNumber and separate text fields for the date, document name, and summary.

2
Open the date calculation

In Prepare a form, double-click the date field. In Properties, select Calculate, choose Custom calculation script, and click Edit.

3
Add the lookup script

Paste this example into the script editor, then click OK: var records = {"DOC-001": {date: "2025-01-15", name: "Sample Document", summary: "Sample summary"}, "DOC-002": {date: "2025-02-20", name: "Second Document", summary: "Second summary"}}; var key = this.getField("DocumentNumber").valueAsString; event.value = records[key] ? records[key].date : "";

4
Configure the other fields

Open Properties > Calculate > Custom calculation script > Edit for the document-name and summary fields. Paste the same lookup script into each, changing records[key].date to records[key].name for the name field and records[key].summary for the summary field.

5
Preview and test

Select Preview in Prepare a form, enter a document number such as DOC-001, and move out of the field. Confirm that all three destination fields display the matching values, then save the PDF.

Use custom calculation scripts to fill the related fields
Keep the lookup data current: The example only recognizes numbers included in the script and leaves the destination fields blank for other values. Update the lookup table in each destination script when the data changes, or use a calculation rule if the values can be derived reliably.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Microsoft Office files. Open existing files to make migration easier; Acrobat-specific JavaScript form automation is not guaranteed to work in WPS.

View PDFs and work with document forms alongside your other filesCompatible with Microsoft Word DOCX and Excel XLSX formatsFamiliar interface for an easier transition from Microsoft OfficeFree, lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Why are the destination fields blank after I enter a document number?

Check that the source field is named DocumentNumber and that the entered value exactly matches a key in the lookup table. Also check each destination field under Properties > Calculate for the correct script.

Can I generate the values instead of maintaining a lookup table?

Yes. If the document number contains enough information to derive a value reliably, use a custom calculation script under the destination field's Properties > Calculate tab to apply that rule.

Do I need a separate script for every destination field?

With the approach shown here, each destination field has its own custom calculation script. The scripts can use the same lookup data, but each must assign the appropriate date, name, or summary to event.value.

What if calculations do not run in Acrobat?

Check Acrobat's form preferences to make sure automatic field-value calculation is enabled, and verify that JavaScript is permitted. Test the form in Acrobat because other PDF viewers may not support the same scripts.