How to Insert a Row at a Specific Position in an Adobe LiveCycle Table
Question details
The user needs to insert a new row directly above or below a selected row in an expanding Adobe LiveCycle table, rather than at the very top or bottom.

- Product
- Adobe LiveCycle
- Device & OS
- not provided
- Scenario
- Editing or creating a dynamic PDF form containing an expanding table where users need contextual row insertion.
- Observed behavior
- The default table behavior only allows appending rows to the top or the bottom of the table, failing to place new rows at a specific index.
Ensure your PDF form is saved as a Dynamic XML Form, as static forms do not support dynamic table expansion or row insertion at runtime. Basic familiarity with the LiveCycle Script Editor is also required.
Use JavaScript and the Instance Manager
Override the default table behavior by using a custom JavaScript snippet to insert a row instance precisely at the current row's index.
By default, expanding tables in LiveCycle append new rows to the bottom. To insert a row exactly where the user is currently working, you must utilize the form's Instance Manager via the Script Editor.
This method relies on determining the current row's index and then calling the insertion method to place a new instance right next to it.
Click on the specific button inside your table row that you want to trigger the insertion (e.g., an 'Add Row Below' button).
Navigate to the Window menu and select 'Script Editor'. Set the language dropdown to JavaScript and ensure it is set to run at the Client.
Write a script to get the index of the row where the button is currently located. You can typically find this using a reference like `this.parent.index`.
Call the insert method on the row's instance manager, such as `_RowName.insertInstance(currentIndex + 1)`, to place the new row exactly below the selected row.
Execute a recalculate command or call `xfa.form.recalculate(1)` to force the form layout to refresh and correctly display the newly inserted row.

Manage PDFs and Tables Effortlessly with WPS Office
While Adobe LiveCycle handles complex dynamic XFA form scripting, WPS Office provides a free, fast, and highly compatible suite for everyday PDF editing, form filling, and standard document creation. It perfectly handles standard tables and offers seamless migration without the steep learning curve.
- 1. Download and Install: Visit the official WPS website and download the free WPS Office suite for your device.
- 2. Open Your Document: Launch WPS PDF or WPS Spreadsheet and open your document to start editing immediately.
- 3. Edit Seamlessly: Use the intuitive top ribbon to insert rows, modify text, or convert file formats with a single click.

Frequently Asked Questions
Why does the default Add Row button only add to the bottom?
The default Add Row action typically uses the addInstance() method, which is programmed to append a new instance to the very end of the subform set. Custom scripting is required to target a specific index.
Can I use FormCalc instead of JavaScript to insert rows?
Yes. FormCalc also supports instance manager methods. You can use standard FormCalc syntax to call the insertInstance method at your desired index instead of JavaScript.
Why is my newly inserted row not showing up correctly in the form?
If the newly added row doesn't display, the form's layout likely hasn't updated. You need to call the remerge or recalculate function on the table or form to force LiveCycle to refresh the display.




