Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to conditionally show sub-forms depending on a data connection file?.

Avatar

Level 3

Hi, let say I have a form that shows a car specification and consists of N parts (sub-forms):

part I

part II

part III

...

part N

Those parts are sub-forms, and given a specific xml data connection file, I need to show the parts if and only iff certain elements of that xml exist or not. Let say, part II is called: "airbag", but if the car doesn't come with airbag (in the xml the airbag section doesn't exist) then the subform should not appear.

How can I do this?.

Thanks!.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

This is the sort of thing you can do with a subformset with the "Select One Subform from Alternatives" option.

There are some examples that come with the install of Designer, from the Designer install directory look in .\EN\Samples\Forms\SubformSet (assuming you want the english one, otherwise change the EN bit).

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

This is the sort of thing you can do with a subformset with the "Select One Subform from Alternatives" option.

There are some examples that come with the install of Designer, from the Designer install directory look in .\EN\Samples\Forms\SubformSet (assuming you want the english one, otherwise change the EN bit).

Bruce

Avatar

Level 3

That seems to be exactly what I'm looking for, thanks!.