3

I can programmatically create a survey list and add questions to it. How do I define branching?

4

Well, it was an epic adventure into lands unknown, and I may have found your answer.

First of all, some background:

  • Questions on a survey are represented by fields in a list (they all inherit from SPField)
  • Choices in a list (and a survey) are stored as an SPFieldChoice

It seems the "Jump To" destinations are associated with the choice field, and can be accessed using SPFieldChoice.ChoicesJumpTo.

The strings in this collection are the Internal Names of the fields (that represent the questions) to jump to.

The position of the items in this collection specifically relate to the positions of the choices in their own collection (e.g. choosing the second option in the drop-down causes the survey to skip to the second field/question named in the JumpTo list).

| improve this answer | |
  • Yep, that's what I ended up doing last year. Thanks for the answer. – user298 Aug 3 '11 at 12:29
  • Better late than never. :) – Stu Pegg Aug 3 '11 at 12:44
  • lol... "epic adventure into lands unknown" – Arturo Aug 25 '14 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.