PDF Editing Issues

Fix Repeating Table Totals in AEM Forms Designer

Maira MehtabMaira Mehtab Nov 3, 2026 870 views

Question details

The user needs to correct calculation scripts in repeatable table instances that are pulling values from the first instance instead of the current one.

How to Fix Repeating Table Totals in AEM Forms Designer
Product
AEM Forms Designer
Device & OS
not provided
Scenario
Designing a dynamic personnel budget form with repeatable table instances that require independent total calculations.
Observed behavior
Totals in secondary table instances incorrectly display values calculated from the first table instance due to hard-coded or improperly scoped scripts.
Before you start

Open your AEM Forms template and locate the Hierarchy palette to clearly identify the names and structure of your repeatable subforms.

Solution 1Recommended

Update Script Scope and Use Relative References

Adjusting the calculation script to use relative references ensures that each table instance calculates totals based exclusively on its own row data.

When a calculation script explicitly references a specific field path (like Position 1), every new table instance will copy the value from that exact path. By replacing absolute references with relative ones, the script will only look for fields within its current subform instance.

1
Select the total field

Click on the total field in your repeating table instance where the incorrect calculation is occurring.

2
Open the Script Editor

Navigate to the Script Editor window (usually at the top of the Designer workspace) and review the current calculation script.

3
Replace absolute references

Remove any hard-coded field references (e.g., explicitly naming the first row's field) and replace them with relative references. Depending on your script language, use commands like 'this' or properly scoped expressions to target the current subform instance.

4
Verify field scoping

Check the Object palette to ensure that each repeated row or subform has properly scoped field names and does not share a global binding that overrides local data.

5
Test the form

Switch to the Preview PDF tab, add a new table instance, input test data, and verify that the totals calculate independently for each row.

Update Script Scope and Use Relative References
Testing Dynamic Forms: Always test dynamic repeatable tables using the Preview PDF tab before publishing to ensure all relative scripts execute correctly.
Free Microsoft Office alternative

Seamlessly Handle Daily PDF and Office Tasks with WPS Office

If your workflow does not require complex enterprise XML scripting like AEM Forms, WPS Office provides a lightweight, easy-to-use suite for filling standard PDF forms, editing documents, and managing spreadsheets.

  1. 1. Open your standard PDF: Launch WPS Office and open your standard PDF form.
  2. 2. Fill the form fields: Click on the interactive form fields to input your data directly.
  3. 3. Save or export: Save your filled PDF or export it securely for sharing.
Easily fill, edit, and sign standard interactive PDF forms without complex scripting.Highly compatible with Microsoft Word, Excel, PowerPoint, and standard PDF formats.Lightweight installation with a familiar, user-friendly interface for seamless migration.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my AEM form copying data from the first row to all new repeating rows?

This usually happens when fields in the repeated rows share the same global data binding or when calculation scripts use absolute paths. Ensure your subform is set to 'Repeat Row for Each Data Item' and that scripts use relative references.

What is the difference between absolute and relative referencing in form scripts?

Absolute referencing points to a specific, hard-coded field in the form hierarchy (like the very first row), while relative referencing uses commands to interact only with the data in the current repeating instance.

Can I build fillable forms without using complex dynamic XML scripts?

Yes, for simple data collection, standard interactive PDFs (AcroForms) are much easier to build and don't require JavaScript or FormCalc scripts. Standard PDF forms can be easily filled and edited using accessible software like WPS Office.