Closed kasar-NTT closed 5 months ago
@kasar-NTT You have set the data using "mergeData". Why should SurveyJS remove them? Using what kind of logic? You can write your own logic by using onValueChanged event and mark questions that has been changed during your session. Based on this information, you can include into your results questions that has been modified during the last session.
Thank you, Andrew
@andrewtelnov i thought the property "clearInvisblevalues": "onComplete"
, would handle that scenario, but it seems that it doesnt.
The docs mention: Clears invisible question values when the survey is complete
@kasar-NTT If you make questions invisible then the values will not be in survey.data on "onComplete" the default behavior. It is about values in invisible questions. I am talking about visible/visibleIf question/page/panel properties. Your questions on the last page are visible. Any other behavior would be treated as a bug by the most of the developers here.
Thank you, Andrew
@andrewtelnov so in order to achieve "my purpose", the only way to do it, would be to have a condition on the questions of the last page that checks the value of the answer that "completes" the questionnaire. Am i right? I' ll try that approach and come back to you
Best regards, Kostas
@kasar-NTT I wrote you early. You can create your own hash, set it on survey.onValueChanged
and send to the server your custom hash of changed values.
Thank you, Andrew
const changedValues = {};
survey.onValueChanged.add((sender, options) => {
changedValues[options.name] = options.value;
});
On complete you can send to your server changedValues object.
Thank you, Andrew
Are you requesting a feature, reporting a bug or asking a question?
Bug
What is the current behavior?
Hidden responded values (answers from next pages) are included onComplete
What is the expected behavior?
Only answered questions should be included onComplete
How would you reproduce the current behavior (if this is a bug)?
You can see the data from next pages on console of sandbox
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://codesandbox.io/p/sandbox/surveyjs-angular-forked-llsrhs?file=%2Fsrc%2Fapp%2Fcomponents%2Fsurvey.component.ts
Test code
Specify your