Question T185
Visible to All Users

how to add the id field to each question?

created 7 years ago

how to add the id field to each question?

Comments (1)

    How to add the field id to each question in the results?

    Answers

    created 7 years ago

    You may do it onComplete event.

    survey.onComplete.add(function(survey, options) {
    var questions = survey.questions;
    for(var i = 0; i < questions.length; i ++) {
    var q = questions[i];
    if(q.isEmpty && !q.isEmpty()) {
    survey.setValue(q.name + "_id", q.id);
    }
    }
    });

    Thank you,
    Andrew