1
I’m using the library of Surveyjs
editor, but in the editor the result is being saved using the name
as a reference to put in the result.
Example : Survey Result: {"question1":"item1","question2":"item2"}.
Example of Json
that creates the questionnaire in the editor :
{
pages: [
{
name: "page1",
elements: [
{
type: "radiogroup",
name: "question1",
title: "Sobre sua vida",
choices: [
"item1",
"item2",
"item3"
]
},
{
type: "radiogroup",
name: "question2",
title: "Sobre seus carros",
choices: [
"item1",
"item2",
"item3"
]
}
]
}
]
}
Result I’m trying to get :
Survey Result: {"Sobre sua vida":"item1","Sobre seus carros":"item2"}.
This is the component link : Surveyjs editor
dvd, thanks for the return, I performed some test and this working, but I’m trying to accomplish this when I call the function "Survey.onComplete.add" because there is a visibleif option of the component that uses the tag name , and if I change this tag name before visibleif will not work. If you have any other suggestions, thank you.
– Carlos Lopes
Okay... I’ll analyze it and I’ll give you an answer
– Sam
Does cloning the JSON and leaving the original intact. How would this function "Survey.onComplete.add"?
– Sam
Survey.onComplete.add(Function (result) { }); it is fired after confirming that the questionnaire is complete then by result.data, collect the result but it does not come as the format I need,I think cloning won’t work... I’m losing my hair from thinking about it so much.
– Carlos Lopes
Then, the result.data is the return of the query. If you create a variable that stores the result.data, type
resultado = result.data;
you can make the changes I proposed and use the two things differently.– Sam
Got DVD, thank you so much for the help!!! With this in mind I will be able to finalize this code , Vlww!!
– Carlos Lopes
Cool... I hope it works. Be sure to mark the famous to close the issue. If you need just call.
– Sam