Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultValueExpression doesn't apply after setting survey.data #7276

Closed
andrewtelnov opened this issue Nov 1, 2023 · 0 comments
Closed

defaultValueExpression doesn't apply after setting survey.data #7276

andrewtelnov opened this issue Nov 1, 2023 · 0 comments
Assignees
Labels
bug user issue An issue or bug reported by users
Milestone

Comments

@andrewtelnov
Copy link
Member

The following code doesn't work correctly:

  const survey = new SurveyModel({
    elements: [
      { type: "text", name: "q1" },
      { type: "text", name: "q2" },
      { type: "text", name: "q3", defaultValueExpression: "{q1} + {q2}" }
    ]
  });
  survey.data = { q1: 1, q2: 2, q3: 3 };
  survey.setValue("q1", 3);

"q3" value should be 5 instead of 3. Howere model believes the data was modified by an end-user and the data is not updated.

@andrewtelnov andrewtelnov added bug user issue An issue or bug reported by users labels Nov 1, 2023
@andrewtelnov andrewtelnov self-assigned this Nov 1, 2023
@RomanTsukanov RomanTsukanov changed the title defaultValueExpression doesn't work after setting survey.data defaultValueExpression doesn't apply after setting survey.data Nov 1, 2023
@JaneSjs JaneSjs modified the milestones: v1.9.116, v1.9.115 Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

2 participants