Question T5574
Visible to All Users

Custom value in questions

created 4 years ago

Hi Support,

I have question regarding the Survey system. What i would like is that i want to give each question a certain hidden ID. The reason for this is that i want to be able to ID every question and perhaps group then. I have looked into the documentation and i seem to be doing something wrong. when i try to add a custom data property i always get the red x. could you help me with what I am doing wrong?
Clipboard-File-1.png

With kind regards,
Wilfred Horden

Answers approved by surveyjs Support

created 4 years ago

Hello,

You need to resister custom property in survey metadata as shown in this live sample - https://surveyjs.io/Examples/Survey-Creator?id=addproperties&theme=default

JavaScript
//add a property to the base question class and as result to all questions Survey .Serializer .addProperty("question", { name: "tag:number", default: 0, category: "general"

If you are using the online editor on our site (https://surveyjs.io/create-survey),,) then it doesn't allow custom properties.

Thanks, Serge