Question T3216
Visible to All Users

Add property

created 5 years ago

I am struggling to add properties into my surveyjs

there is my code

this.surveyCreator = new SurveyCreator.SurveyCreator(
      "surveyCreatorContainer",
      options
    );

var categories = [null,"reaction time","time analysis","heart rate"]
          Survey.JsonObject.metaData.addProperty("questionbase", {name: "category1",
          choices: categories});
          Survey.JsonObject.metaData.addProperty("questionbase", {name: "category2", choices: categories});
          Survey.JsonObject.metaData.addProperty("questionbase", {name: "category3", choices: categories});

Survey.StylesManager.applyTheme("bootstrap");

Answers approved by surveyjs Support

created 5 years ago

Hello,

You need to add properties before SurveyJS Creator constructed and use the question class instead of questionbase.
Here is the live sample from our site - https://surveyjs.io/Examples/Survey-Creator/?id=addproperties&theme=bootstrap

Thanks, Serge
SurveyJS Team

    Show previous comments (24)

      Hello,

      I've created a separate ticket on your behalf (T3502: Is it possible to install surveyjs in .NET Mvc C#?). It has been placed in our processing queue and will be answered shortly.

      Thanks, Serge
      SurveyJS Team

        Hello Team!!

        How to set value of custom properties?

        On 2/27/2020 3:37 PM, Support Support wrote:

          Hello,

          I've created a separate ticket on your behalf (T4037: How to set a value to a custom property?). It has been placed in our processing queue and will be answered shortly.

          Thanks, Serge
          SurveyJS Team