If single choice selected, then expand other questions (before rendered)

Hello evereyone,

I'm looking for a way to "expand" an accordion with special questions IF.

So, the main idea should be, I have a question A, if user answer YES (drop down question type), it open/expand the accordion named "accordion example" with questions B C and D, for example.

And, the problem is : how can I do it without rendered the form, it is a "change" js code or something ?

Thanks for giving me ideas here,

Hi @lolopixxx,

You can open an Accordion panel following this example in our documentation. The code should look something like this:

fd.spRendered(() => {
    if (fd.field('Choice').value === 'Choice 1') fd.container('Accordion').$children[0].open = true;
});

You can also open or close accordion tabs in fd.spSendered(), but field values would be inaccessible. If you absolutely have to change the accordion before the form is rendered, try getting the field value from the list with PnP.