Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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).

share|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. :) –  Stuart Pegg Aug 3 '11 at 12:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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