Submit Selected Acrobat Form Items as CSV or XLSX
Question details
Submit only ordered line items from a multi-page Acrobat form as CSV or XLSX data.

- Product
- Adobe Acrobat PDF forms
- Device & OS
- not provided
- Scenario
- A user selects quantities in a PDF catalog and wants to send only the ordered items rather than the complete PDF.
- Observed behavior
- The desired submission contains the quantity, description, code, and item values for rows with a positive quantity.
In Acrobat, open All tools > Prepare a form and check the field names for each line item. You will also need a server endpoint that can receive form data and save it as CSV or convert it to XLSX.
Submit selected rows to a server with Acrobat JavaScript
Use a custom button to collect rows with positive quantities and send their CSV data to an endpoint that creates the requested file.
This approach submits a CSV string in a form field, not the complete PDF. The receiving server must extract that field and save it as CSV or convert it to XLSX.
The example expects fields named qty_1, description_1, code_1, and item_1 for the first row, with the same pattern for subsequent rows.
Open All tools > Prepare a form and verify that each row has consistently numbered quantity, description, code, and item fields. Update the example field names if your form uses a different naming pattern.
In Prepare a form, add a multiline text field named order_csv and set it to hidden in its properties. Add a button labeled Submit Order.
Open the button's Properties > Actions, select Mouse Up and Run a JavaScript, and add the following script. Replace the URL and row count with your endpoint and the number of catalog rows: (function () { var rowCount = 100; var endpoint = "https://example.com/receive-order"; var lines = ["Quantity,Description,Code,Item"]; function csv(value) { return '"' + String(value).replace(/"/g, '""') + '"'; } for (var i = 1; i <= rowCount; i++) { var qty = this.getField("qty_" + i); var description = this.getField("description_" + i); var code = this.getField("code_" + i); var item = this.getField("item_" + i); if (!qty || !description || !code || !item) { app.alert("Missing form field in row " + i + "."); return; } if (Number(qty.valueAsString) > 0) { lines.push([qty.valueAsString, description.valueAsString, code.valueAsString, item.valueAsString].map(csv).join(",")); } } if (lines.length === 1) { app.alert("Enter a positive quantity for at least one item."); return; } this.getField("order_csv").value = lines.join("\r\n"); this.submitForm({cURL: endpoint, cSubmitAs: "HTML", aFields: ["order_csv"]}); }).call(this);
Configure the endpoint in your server application to accept the submitted order_csv form field. Save its contents as a .csv file, or parse the CSV and write the rows to an .xlsx workbook using a spreadsheet library.
Open the form in Acrobat, enter positive quantities for a few rows, leave others at zero, and click Submit Order. Check the server output to confirm that only the selected rows appear.

Review submitted order files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for opening and working with order spreadsheets. It supports common Microsoft Office formats for easier migration, but it does not configure the Acrobat form's custom submission action.

Frequently Asked Questions
Can Acrobat submit an XLSX file directly from this script?
The example submits CSV text as an HTML form field. To produce an XLSX file, configure the receiving server to parse that text and write it to a workbook.
How does the script exclude unselected items?
The button script checks each quantity field and adds a row only when its numeric value is greater than zero. Zero, blank, and nonnumeric values are not included.
What if my form fields have different names?
Open All tools > Prepare a form to inspect the names, then change the getField calls in the button script to match your naming pattern. Adjust rowCount to match the catalog.
Will the Submit button work in every PDF viewer?
No. PDF viewers differ in their support for Acrobat JavaScript and network submission. Test the completed form in the Acrobat environment your users will use.




