Repeatable panel behavior with minimum repetitions and visibility rules in AEM Adaptive Forms

In AEM Adaptive Forms Core Components, Minimum repetitions sets the minimum number of repeatable instances; it does not set the initial instance count to zero. A repeatable panel starts with one instance when no initial count is specified. Visual Rule Editor rules on a repeatable panel apply to the last instance, and the tested nested-wrapper pattern can interfere with Add Instance. To design the form safely, test the initial render, visibility rules, and Add Instance behavior in the target environment.

Description description

Environment

AEM as a Cloud Service Adaptive Forms using Core Components and repeatable panels

Issue/Symptoms

  • Setting Minimum repetitions to 0 does not produce a zero-instance initial render in the reviewed Core Components runtime.
  • A Show/Hide rule on a repeatable panel does not reliably control the visibility of every instance. Adobe documents that Visual Rule Editor rules on a repeatable panel apply to the last instance.
  • In the tested nested-panel pattern, wrapping a repeatable panel in a non-repeatable panel to control visibility interferes with Add Instance.

Cause

When an initial item count is not explicitly set, the reviewed runtime initializes a repeatable panel with at least one instance using Math.max(1, minItems). The minimum repetition value therefore does not, by itself, request zero initial instances. Visual Rule Editor rules on repeatable panels apply to the last instance, rather than controlling all instances. The tested nested-wrapper pattern also interferes with Add Instance, so validate any alternative form structure in the target environment.

Resolution resolution

Follow these steps to design and test repeatable-panel behavior:

  1. In AEM as a Cloud Service Adaptive Forms Core Components, treat Minimum repetitions as the minimum allowed count, not as a request for zero initial instances. When initialItems is not set explicitly, the runtime initializes at least one instance. Setting minimum repetitions to zero allows all instances to be removed; it does not, by itself, produce a zero-instance initial render.
  2. Do not rely on one Visual Rule Editor rule attached to a repeatable panel to control every instance. Adobe documents that rules created on a repeatable panel apply to the last instance. If the requirement targets another specific instance, use the documented custom-function approach and test it in the target form.
  3. Avoid wrapping a repeatable panel in a non-repeatable panel solely to apply Show/Hide rules unless the exact structure has been tested. In the documented nested-panel reproduction, this wrapper interfered with Add Instance.
  4. If the form requires zero instances at initial load or conditional visibility across repeatable instances, redesign the form or use a custom panel implementation reviewed for the target runtime. Do not treat a wrapper as a supported workaround without verifying Add Instance and related rules.
  5. Preview or render the form. Verify the initial instance count, the expected Show/Hide behavior, and Add Instance and Remove Instance actions, including the nested structure used in the form.
recommendation-more-help
experience-cloud-kcs-help-kbarticles