How do SubQuestions work


In the V5 documentation on the Question object:

It talks about the surveyquestion parameter.  This makes it seem like you can nest questions underneath each other:

surveyquestionID of question to add sub-question toFalse

We’d like to take advantage of this feature to nest essay questions, file attachments, numeric text entry fields, etc. under other questions in a parent/child type relationship.

However, when I pass in a value for the surveyquestion parameter, nothing different happens.  Here are the inputs that I’m passing in:

PutQuestion: type=RADIO&title=First%20Question%20-%20Nothing%20to%20see%20here&shortname=First%20Question%20-%20Nothing%20to%20see%20here&comment=true&properties[orientation]=HORZ&properties[required]=true

PutSubQuestion: type=essay&surveyquestion=2&comment=true&properties[required]=false

Does this feature work?  If so, how should I best take advantage of it?

Dominic Sharpe answered

    The surveyquestion parameter is primarily for building Grid/Table Questions (also Custom Group questions).

    In the case of a grid, the sub-question would refer to a grid row.

    So, for example, you could create a question with type table-radio and then once you get the ID of the table-radio, you can supply that ID to the surveyquestion parameter in order to add a row to that grid.

    Hope that helps clarify!

    Steven commented
      • Ok, so a very specific parent-child relationship, not a more generic one. I appreciate the response and the clarification!



      Question stats

      • Active
      • Views3670 times
      • Answers1 answer
      • Followers1 follower