Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Changing default value of a question via remote API

  • oledole
  • oledole's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 1 week ago #196532 by oledole
Hi.

So I have a survey with a multiple choice (type M) question where the user can check one or more values from the choices they have.

I have an app that creates new survey by copying this. On this app, they have a multiple choice menu just like in the survey.

What I want to achieve is that the choices selected in the app is automatically selected in the survey. I wanted to do this through the remote API, but I cannot figure out how to change the default value of a question/subquestion.

I tried with a call in postman.

{
"method": "set_question_properties",
"params": [
"VeO6jp8HEFifdigxg705jnZRir7A6qCl", <-- Token
"61915" <-- subquestion ID,
{
"title": "SQ002"
}
],
"id": 1
}

This works. I get back:

{"id":1,"result":{"title":true},"error":null}

But I cannot find out what to use (instead of title) to change the default value. I tried with defaultvalue, answers, answeroptions, available_answers, but I always get back:

{"id":1,"result":{"status":"No valid Data"},"error":null}

Is it possible? And if so, how can I do it?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose