Hi, I'm wondering can we use survey.setVariable with value is an object, and how we can use that in json of surveyjs?
Another question, with choicesByUrl, the properties titleName, valueName, can we access that with some syntax like JsonPath or Xpath, or something else?
Ex: the response from Url is an object, there is an array in that object. And I just want to set titleName with a specific element in that array.
Thank you
setVariable with object
Show previous comments
(0)
Comments
(0)
Sign in to comment on this post
Answers approved by surveyjs Support
Hello,
We have defaultValue property that will be set to the question on loading the JSON.
Regarding choicesByUrl, without seeing your service and your properties, it is hard to suggest something.
Thank you,
Andrew
SurveyJS Team
Show previous comments
(1)
AT
6 years ago
Hello,
Sorry, I did not get it.
Here is the example of using defaultValue.
Thank you,
Andrew
SurveyJS Team
I know how to using defaultValue :(
I just don't know do we support setVariable with an object or not? (First question)
AT
6 years ago
Why do you need it? I do not get it. You should assign value of the choice item (ItemValue class) and not other properties.
Thank you,
Andrew
SurveyJS Team