Other PDF Issues

How to Insert a Row at a Specific Position in an Adobe LiveCycle Table

Tauseeq MagsiTauseeq Magsi Nov 2, 2026 869 views

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.

How to Insert a Row at a Specific Position in an Adobe LiveCycle Table
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the Trigger Button

Click on the specific button inside your table row that you want to trigger the insertion (e.g., an 'Add Row Below' button).

2
Open the Script Editor

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.

3
Retrieve the Current Row Index

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`.

4
Insert the New Instance

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.

5
Reindex the Table

Execute a recalculate command or call `xfa.form.recalculate(1)` to force the form layout to refresh and correctly display the newly inserted row.

Use JavaScript and the Instance Manager
Script Customization: You can modify the index parameter (e.g., subtracting 1 instead of adding 1) to easily switch between inserting the row above or below your current selection.
Free Microsoft Office alternative

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. 1. Download and Install: Visit the official WPS website and download the free WPS Office suite for your device.
  2. 2. Open Your Document: Launch WPS PDF or WPS Spreadsheet and open your document to start editing immediately.
  3. 3. Edit Seamlessly: Use the intuitive top ribbon to insert rows, modify text, or convert file formats with a single click.
Easily edit standard PDF tables, text, and images without complex scriptingSeamless format compatibility with Microsoft Word, Excel, and PowerPointLightweight architecture ensures fast loading on any deviceCompletely free core features for everyday document tasks
QA img-9

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.