PDF Editing Issues

How to Import PDF Drop-Down Items with Export Values in Acrobat

Algirdas JasaitisAlgirdas Jasaitis Nov 10, 2026 868 views

Question details

The user needs a method to bulk import a large number of drop-down or list items into a PDF form, where each item requires a distinct display label and a corresponding background export value.

How to Import PDF Drop-Down Items with Export Values Using JavaScript
Product
PDF Forms
Device & OS
not provided
Scenario
Creating complex interactive PDF forms that require populating a combo box or list field with over 100 options without entering them manually one by one.
Observed behavior
The goal is to programmatically inject dual-value arrays (display name versus export value) into a specific drop-down field.
Before you start

Ensure you have access to the document-level JavaScript console or field action properties in your PDF editor, and verify the exact, case-sensitive field name of your target drop-down menu.

Solution 1Recommended

Use Acrobat JavaScript's setItems Method

Programmatically populate your drop-down field by passing an array of two-item arrays, which defines both the visible display text and the hidden export value simultaneously.

The setItems method allows you to inject an entire list of options into a combo box or list box instantly. By structuring your input as an array of arrays, the script automatically assigns the first string to the user interface and the second string to the underlying data value.

1
Identify the Target Field

Open your PDF form in edit mode and check the exact name of your Dropdown or Combo Box field (e.g., "Dropdown").

2
Open the JavaScript Console

Navigate to the JavaScript editor in your PDF application. This can typically be found under the document-level scripts or by adding a custom action to a temporary button.

3
Format Your Data Array

Structure your 100+ items into two-item arrays. The syntax follows this pattern: [["Display Label 1", "Export Value 1"], ["Display Label 2", "Export Value 2"]].

4
Execute the Script

Input and run the following code snippet: this.getField("Dropdown").setItems([["GEOG 101", "3"], ["GEOG 101L", "1"], ["GEOG 102", "3"]]);

Use Acrobat JavaScript's setItems Method
Default Selection: The first item in your array will automatically become the default selected item in the drop-down list once the script executes.
Edit and Manage PDF Forms

Handle Interactive PDF Forms with WPS Office

While complex JavaScript arrays might require specialized scripting environments, WPS Office provides a comprehensive PDF editor that allows you to easily view, fill, and manage interactive PDF forms without writing code.

  1. 1. Open the PDF Form in WPS: Launch WPS Office and open your interactive PDF document using the built-in WPS PDF tool.
  2. 2. Access Form Controls: Navigate to the Form tab to interact with text fields, combo boxes, and drop-down menus within your document.
  3. 3. Fill and Export: Select your desired drop-down items, then easily save your filled PDF or export the document for further processing.
Seamlessly fill and interact with complex PDF drop-down menus and form fields.Fully compatible with standard Adobe PDF files and Microsoft Office formats (Word, Excel, PowerPoint).Lightweight, cross-platform office suite with an intuitive, user-friendly interface.
microsoft office alternative - wps office

Frequently Asked Questions

What is the difference between a display label and an export value in a PDF drop-down?

The display label is the text the user sees and selects in the drop-down menu (e.g., "Yes"). The export value is the underlying data that gets submitted, exported, or used in calculations when that option is chosen (e.g., "1").

Can I copy and paste 100 items directly into the PDF field properties?

In most standard PDF editors, you cannot bulk paste hundreds of items with distinct export values directly into the properties UI. You must either use a JavaScript method like setItems or a dedicated batch import utility.

Why isn't my JavaScript code updating the drop-down list?

Ensure the field name in this.getField("YourFieldName") exactly matches the actual name of your drop-down field, including case sensitivity. Also, verify that your array syntax is perfectly formatted without missing brackets or quotation marks.

Are JavaScript form methods compatible with all PDF viewers?

Not all PDF viewers support Acrobat JavaScript. While forms will work perfectly in Adobe Acrobat and robust editors, some basic browser-based PDF readers may not execute the scripts or process export values correctly.