Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Is there a way to determine the number of instances of a subform from workbench?

Avatar

Level 1

I want to loop through a process for each instance of a sub-form (there may be one instance up to three on a particular form).

1 Reply

Avatar

Level 10

This must be possible.

If your form has a subform named EmployeeInfo which repeats upto thrice.

Your form's XML data will have three Tags named EmployeeInfo (in case your schema has the same tag name).

Within workbench (in your process) you can loop through based on the number of sub-form instances present inthe form.

XPATH to find the number of instances: count(/process_data/your_xml_variable/root_tag/EmployeeInfo)

Hope that helps.

Nith