Question T5767
Visible to All Users

custom property of the survey object

created 4 years ago

Hello, I wish to add a custom property to the json that I model my survey with. The intention is to have a flag, designated by the survey designer, that wont change anything visible with the survey, but will allow us to read this flag as a property of the survey and activate an element of the parent class that houses the survey component accordingly. (working in react)

Example the survey designer wants the survey on our site to be displayed next to a graphic of a flag. so he wants to add that to the json a property called "flaggyMcFlagFace", set to true. then when we load the survey model from the json, we can read that property from the parent component in order to enable the flag picture or not

If there is no way to do this, is there any redundant property that we can repurpose for this instead?

Answers approved by surveyjs Support

created 4 years ago

Hello,

I believe a new custom property is exactly what you need.

Thanks, Serge
SurveyJS Team

    Comments (2)
    N N
    Nadav Gur-Arieh 4 years ago

      Not exactly what I was going for.
      Besides going to the json and adding a new property directly, is there any functionality in the Survey Creator that can add a custom property to the json? Or does it all have to be done at runtime with
      Survey.Serializer.addProperty?

        Hello,

        is there any functionality in the Survey Creator that can add a custom property to the json

        It's not a creator functionality. Only SurveyJS library is responsible for properties configuration.

        By the way SurveyJS Creator is a commercially licensed product. If you have a license please write us from a email linked to one.

        Thanks, Serge
        SurveyJS Team