Question T14447
Visible to All Users

How to get question numbers for survey creator?

created a year ago

Hi Team,

I need to get question numbers for each question in survey creator, I checked creator.survey but cannot find any function/property to get question numbers, can you please guide us on the same!

Answers approved by surveyjs Support

created a year ago

Hello Santosh,
A question number can be accessed via the question.no property. Please note that question numbers are available if numbers are enabled for questions. For instance, the following code loops through survey questions and prints question numbers to a console:

JavaScript
creator.survey.getAllQuestions().forEach((q) => { console.log(q.no); });

View Demo

Please let me know if this information helps.

    Comments (2)

      Thanks Jane for the response, It works!

        You're welcome! Please feel free to contact us if you have any further questions.