Question T9115
Visible to All Users

Difference for model.data and model.setDataCore

created 3 years ago (modified 3 years ago)

Hi, I have a json with many invisible questions.

Code
const surveyObject = new SurveyLib.SurveyModel(json);

When I do surveyObject.setDataCore({a: 123});
and console.log(surveyObject.data), it will print out a:123 with other invisible questions.

but when I do surveyObject.data = ({a: 123}), this one will print the exact value.

I want to understand the difference between these cz when I run surveyObject.runTrigger, it will cause issue.
When surveyObject.runTrigger, this is based on the data set by surveyObject.setDataCore, or surveyObject.data ?

Comments (1)

    Hello,
    In fact you can choose between setting survey.data or using survey.mergeData.

    Thank you,
    Andrew
    SurveyJS Team