Skip to content

Dynamic Panel - A valueName question property is not updated when a Dynamic Panel is duplicated #7455

@JaneSjs

Description

@JaneSjs

T26528 - Duplication Errors
https://surveyjs.answerdesk.io/internal/ticket/details/T26528


Original JSON:

{
  "pages": [
    {
      "name": "page1",
      "elements": [
        {
          "type": "paneldynamic",
          "name": "p1",
          "templateElements": [
            {
              "type": "slider",
              "name": "p1_q1",
              "description": "Select between 20 and 80",
              "validators": [
                {
                  "type": "expression",
                  "expression": "{panel.p1_q1} > 20 and {panel.p1_q1} < 80"
                }
              ]
            },
            {
              "type": "text",
              "name": "question1",
              "valueName": "p1_q1"
            }
          ]
        }
      ]
    }
  ]
}

Duplicate a dynamic panel:

{
  "pages": [
    {
      "name": "page1",
      "elements": [
        {
          "type": "paneldynamic",
          "name": "p1",
          "templateElements": [
            {
              "type": "slider",
              "name": "p1_q1",
              "description": "Select between 20 and 80",
              "validators": [
                {
                  "type": "expression",
                  "expression": "{panel.p1_q1} > 20 and {panel.p1_q1} < 80"
                }
              ]
            },
            {
              "type": "text",
              "name": "question1",
              "valueName": "p1_q1"
            }
          ]
        },
        {
          "type": "paneldynamic",
          "name": "question2",
          "templateElements": [
            {
              "type": "slider",
              "name": "question3",
              "description": "Select between 20 and 80",
              "validators": [
                {
                  "type": "expression",
                  "expression": "{panel.p1_q1} > 20 and {panel.p1_q1} < 80"
                }
              ]
            },
            {
              "type": "text",
              "name": "question4",
              "valueName": "p1_q1"
            }
          ]
        }
      ]
    }
  ]
}

In a copied Dynamic panel, the question4 field's value name was not updated and contains the original field reference: p1_q1.

Expected behavior: the valueName is updated to link to a new question.

{
   "type": "text",
   "name": "question4",
   "valueName": "question3"
}

Metadata

Metadata

Assignees

Labels

user issueAn issue or bug reported by users.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions