Hi, everybody in SurveyJS !!
I come back to get a help to solve a problem / issue.
I have a json like:
JSON{
"locale": "pt",
"title": "Pedido de Request For Disposal VM – SELF SERVICE",
"description": "Preencha os campos abaixo com a informação devida.",
"focusFirstQuestionAutomatic": false,
"pages": [
{
"name": "Dados",
"elements": [
{
"type": "panel",
"name": "panel_project_manual",
"elements": [
{
"type": "panel",
"name": "panel2",
"elements": [
{
"type": "text",
"name": "project_manual",
"width": "400px",
"minWidth": "400px",
"maxWidth": "400px",
"title": {
"pt": "Introduza o nome do Serviço/Projeto"
},
"requiredIf": "{project_type} = 1"
}
],
"visibleIf": "{project_type} = 1"
},
{
"type": "panel",
"name": "panel_project",
"elements": [
{
"type": "dropdown",
"name": "project",
"width": "400px",
"minWidth": "400px",
"maxWidth": "400px",
"title": {
"pt": "Introduza o nome do Serviço/Projeto"
},
"requiredIf": "{project_type} = 2",
"renderAs": "select2",
"choicesByUrl": {
"url": " https://dev1.xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"path": "values",
"valueName": "name",
"titleName": "name"
}
}
],
"visibleIf": "{project_type} = 2"
},
{
"type": "panel",
"name": "panel_no_tservice",
"elements": [
{
"type": "text",
"name": "no_tservice",
"defaultValue": "1",
"requiredIf": "{project_type} = 0"
}
],
"visible": false
},
{
"type": "panel",
"name": "panel6",
"elements": [
{
"type": "text",
"name": "project_type",
"isRequired": true
}
],
"visible": false
},
{
"type": "panel",
"name": "panel4",
"elements": [
{
"type": "dropdown",
"name": "group",
"width": "300px",
"maxWidth": "300px",
"title": {
"pt": "Equipa Aplicacional "
},
"isRequired": true,
"renderAs": "select2",
"choicesByUrl": {
"url": "https://dev1.xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"path": "values",
"valueName": "uid",
"titleName": "name"
}
},
{
"type": "text",
"name": "contact_name",
"width": "400px",
"minWidth": "400px",
"maxWidth": "400px",
"title": {
"pt": "Nome Responsável Técnico"
},
"isRequired": true
},
{
"type": "text",
"name": "contact_phone",
"width": "300px",
"maxWidth": "300px",
"title": {
"pt": "Telefone Responsável Técnico"
},
"isRequired": true,
"validators": [
{
"type": "regex",
"text": {
"pt": "Deve preencher com um número de contacto válido"
},
"regex": "^(2|3|9)[0-9]{8}"
}
]
}
]
}
]
}
]
},
{
"name": "Geral",
"elements": [
{
"type": "panel",
"name": "panel3",
"elements": [
{
"type": "text",
"name": "data_shutdown",
"width": "200px",
"minWidth": "200px",
"maxWidth": "200px",
"renderAs": "select2",
"title": {
"pt": "Data de Shutdown de VM´s"
},
"description": {
"pt": "Os pedidos de remoção de Virtual Machines serão realizados 2 dias após abertura do pedido."
},
"isRequired": true,
"inputType": "date"
},
{
"type": "tagbox",
"name": "hostnames",
"width": "500px",
"minWidth": "500px",
"maxWidth": "500px",
"title": {
"pt": "Hostname (Listagem)"
},
"isRequired": true,
"renderAs": "select2",
"choicesByUrl": {
"url": "https://dev1.xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"path": "values",
"valueName": "hostname",
"titleName": "hostname"
}
},
{
"type": "panel",
"name": "panel5",
"elements": [
{
"type": "comment",
"name": "question4",
"width": "500px",
"minWidth": "500px",
"maxWidth": "500px",
"title": {
"pt": "Informações adicionais"
},
"cols": ""
}
]
}
]
}
]
}
],
"showQuestionNumbers": "off",
"storeOthersAsComment": false,
"textUpdateMode": "onTyping",
"completeText": "Gravar",
"serviceName": "RequestRFDAuto"
}
And I don't access or get the tagbox question in node.js code by survey.getAllQuestions()
and where do I use import { default as Survey } from "survey-knockout/survey.ko.js"
TypeScriptfunction getErrors(survey) {
var errors = [];
survey.getAllQuestions().forEach(element => {
logger.error('CP4: ' + element.name);
element.hasErrors(false, false, true);
element.errors.forEach( errElem => {
errors.push({question: element, error: errElem, name: element.name, value: element.value});
});
});
return errors;
}
If is possible to solve this issue ?? or where Do I make a mistake ??
Thanks in advance
Luis Fernandes Monteiro Silva