Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

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


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


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.