Question T10304
Visible to All Users

How to find custom property

created 2 years ago

I am able to log survey.getQuestionByName('opSystem').description or title or isRequired
but how can I access the popupDescription custom property?

Answers approved by surveyjs Support

created 2 years ago

Hello,

For JavaScript you can just write:

JavaScript
survey.getQuestionByName('opSystem').popupDescription

For TypeScript you may need to access property by name in a string:

TypeScript
survey.getQuestionByName('opSystem')["popupDescription"]

Thank you,
Alex
SurveyJS Team

    Show previous comments (1)

      Hello,

      Have you defined your custom property in question class?

      JavaScript
      // add a property to the base question class and as result to all questions Survey.Serializer.addProperty("question", { name: "popupDescription:text", default: "", category: "general" });

      Thank you,
      Alex
      SurveyJS Team

        Love you so much <3

          You are very welcome!

          Andrew
          SurveyJS Team