Question T2628
Visible to All Users

Support for 'sub surveys'

created 5 years ago

Hi

I would like to re-use small pre-existing Surveys in a new Survey. For instance - say we have three existing Surveys …

  • Mastercard
  • Visa
  • Discover

Each one of the above three surveys has its own set of questions. I want to be able to create a question in a new survey called 'New Order Survey' with the following question text …

'Please select your Payment Method'

the available answers to this question are the names of the three existing Surveys (Mastercard, Visa, Discover).

When the user chooses a Payment Method the questions associated with that 'sub survey' are displayed and the user has to answer them.

The whole point of this is to be able to 'package' the questions associated with each credit-card in its own survey so that 'sub survey' can be re-used in a new survey without copying/pasting its questions.

Is this possible ? If so - how ?

Thanks
Dave

Answers approved by surveyjs Support

created 5 years ago

Hello Dave,
Here is the example of combining several surveys in one by using templates.
Let us know if it suites you.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (2)

      Alex, Dave want to reuse the same some questions/pages in many surveys. He may modify one template and as result other his surveys will be changed as well.

      Dave, yes, you can do this of course. You may do the same even with panels and introduce templates into panels as well.

      Thank you,
      Andrew
      SurveyJS Team

        Hi Alex

        Thanks for the clarification.

        Can you provide an example of how to embed/insert a template (what I'm calling a sub-survey) between two sets of questions in the 'parent' survey ? Here's the same scenario I suggested above …

        So …

        say the first question in the parent remains 'Please choose the payment type'
        then the 'sub surveys' (templates) are displayed based on paymentType.
        followed by a set of 'address' questions (address1, address2, city, state, etc…) if the paymentType is not banktransfer_template
        if the paymentType is banktransfer_template then the 'address' questions are skipped and replaced with a question asking for a bank routing number

        Thanks
        Dave

          Dave, take a look at the updated example.

          Thank you,
          Andrew
          SurveyJS Team