Hi, I made a survey in wich i have this structure :
page
panel1
panel2
question1
question1 is in panel2, panel2 is in panel1. When i call getAllQuestions, i receive 2 question1. Is it possible to receive only one question1 because i must validate that all questions as a unique name by code like this :
// Validate duplicate question name
const questionsName: string[] = [];
console.log(this.surveyCreator.getAllQuestions());
this.surveyCreator.getAllQuestions().forEach(question => {
if (questionsName.includes(question.name)) {
if (this.localeId === 'fr-ca') {
error = 'Plus d'une question porte le nom ' + question.name + '. Chaque question doit avoir un nom unique.';
} else {
error = 'More than one question has the name ' + question.name + '. Each question must have a unique name.';
}
currentErrors.push(error);
} else {
questionsName.push(question.name);
}
});