Question T15214
Visible to All Users

Copy values from dynamic panel which is inside another dynamic panel to dynamic panel which is inside another panel

created a year ago

Hello. Is there any way to copy values from dynamic panel D (which has 1 input field and 3 initial panels in this example) to dynamic panel C? Panel C should create panel for each panel in panel D.
Untitled.png

Show previous comments (2)

    Hello Saulius,
    Thank you for the update. Unfortunately, a survey doesn't have an option to convert a multi-dimension array, which are built from the Dynamic Panel placed within a Dynamic Panel (Panel B -> Panel D) into a two-dimensional array which is Panel C placed within Panel A.

    As an option, you can handle this programmatically. For instance, subscribe to the survey.onPanelAdded and survey.onPanelRemoved events to handle Panel D panel adding and removing. When this happens, programmatically create or remove panels for the Panel C question using the QuestionPanelDynamicModel.addPanelUI and QuestionPanelDynamicModel.removePanelUI functions.

    Should you have any further questions, we are here to help.

    Thanks

      Hello. You suggested to use survey.onPanelAdded event. But this event is raised when a new panel is added to a page. I need event to be triggered when new panel is added to a Dynamic Panel question. Would it be better to use: onDynamicPanelAdded?

        Hello,
        Thank you for the update. Yes, you're right. Please accept my apologies for the oversight. Please use the onDynamicPanelAdded/ onDynamicPanelRemoved events to manage panels.

        Please let me know if you have any questions.