Convert Adobe Form Table Entries to a Comma-Separated String
Question details
Combine multiple Adobe form table entries into a single comma-separated line.

- 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.
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.
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.
Open the PDF in Adobe Acrobat and select Tools > Prepare a Form, or select Prepare a form from the tools menu.
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.
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(", ");
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.

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. Open a spreadsheet: Open WPS Spreadsheets and create a blank workbook.
- 2. Enter the values: Type or paste three form entries into cells A1, A2, and A3.
- 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. Copy the result: Copy the displayed result from B1 and paste it into the desired form field.

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.




