Question T12960
Visible to All Users

Default value for property

created 2 years ago

Hello !

I'm looking through the documentation and I can't find a simple way to set a default value to a Survey Creator property

I would like to set the isAllRowRequired property to true by default

Can I do it easily from ICreatorOptions?

Thank you!

Answers approved by surveyjs Support

created 2 years ago

Hello,
To set a default value for a property, get the property using the Survey.Serializer.getProperty function and specify the property's defaultValue setting. For instance:

JavaScript
import { Serializer } from "survey-core"; Serializer.getProperty('matrix', 'isAllRowRequired').defaultValue = true;

Please let me know if you have further questions.