PDF Editing Issues

Convert Adobe Form Table Entries to a Comma-Separated String

John WilsonJohn Wilson Nov 25, 2026 869 views

Question details

Combine multiple Adobe form table entries into a single comma-separated line.

Convert Adobe Form Table Entries to a Comma-Separated String
Product
Adobe Acrobat Forms
Device & OS
not provided
Scenario
A form contains table entries that need to appear together in one output field, such as item1, item2, item3.
Observed behavior
The desired output is one line with each entry separated by a comma and a space.
Before you start

Identify the exact names of the source fields and the field that will display the combined text. The Acrobat script below is for standard PDF form fields; dynamic XFA forms require different field references.

Solution 1Recommended

Join Adobe Acrobat form field values with a calculation script

Use this approach to update an output field automatically from a fixed set of standard PDF form fields.

The example reads three named fields into an array, skips empty fields, and joins their values with a comma and space. Replace the example names with the actual field names in your form.

1
Open the form editor

Open the PDF in Adobe Acrobat and select Tools > Prepare a Form, or select Prepare a form from the tools menu.

2
Check the field names

In the form editor, inspect the source fields and add or select a text field for the combined result. Note the exact source field names.

3
Add a calculation script

Open the output text field's Properties, select Calculate > Custom calculation script, and click Edit. Enter: var names = ["Item1", "Item2", "Item3"]; var values = []; for (var i = 0; i < names.length; i++) { var field = this.getField(names[i]); if (field && field.valueAsString !== "") values.push(field.valueAsString); } event.value = values.join(", ");

4
Test the result

Close the properties dialog, preview the form, and enter values in the source fields. Check that the output field displays the entries on one line, separated by commas and spaces.

Join Adobe Acrobat form field values with a calculation script
Dynamic tables: If your form uses repeating XFA rows, the script must traverse the actual row structure instead of using this.getField. The required code depends on the table and field names.
Combine entries in WPS Spreadsheets

Create a comma-separated line with WPS Spreadsheets

For a manual alternative, place the form entries in WPS Spreadsheets, combine them with a formula, and copy the resulting line into your form. This does not add an automatic calculation to the Adobe form.

  1. 1. Open a spreadsheet: Open WPS Spreadsheets and create a blank workbook.
  2. 2. Enter the values: Type or paste three form entries into cells A1, A2, and A3.
  3. 3. Combine the cells: Select cell B1 and enter =A1&", "&A2&", "&A3, then press Enter. Adjust the cell references or add more references for your entries.
  4. 4. Copy the result: Copy the displayed result from B1 and paste it into the desired form field.
Combine table entries into one comma-separated lineOpen and save Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceEdit and reuse the combined text
microsoft office alternative - wps office

Frequently Asked Questions

How do I change which form fields are included?

In Acrobat's Prepare a form tool, open the output field's Properties > Calculate and edit the names array in the custom calculation script to match your source field names.

Can the script skip empty entries?

Yes. The example checks that each field exists and that its value is not an empty string before adding it to the array.

Will the Acrobat script work with repeating XFA table rows?

Not as written. Repeating XFA tables use a different structure, so the script must traverse the form's actual rows and field names.

Can WPS Spreadsheets update the Adobe form automatically?

The spreadsheet formula creates a separate result that you can copy into the form. Automatic updates inside an Adobe form require a form calculation configured in Adobe's form tools.