ISaveToJSONOptions

An interface with configuration options that control how a SurveyModel instance is serialized by the toJSON() method.

Methods
Events
locales property

Specifies the locales to include in the exported JSON schema. Applies only when storeLocaleStrings is true or "stringsOnly".

Type:
string[] readonly
Implemented in:
ISaveToJSONOptions
storeDefaults property

Specifies whether the exported JSON schema should include properties whose values are equal to their defaults.

Default value: false

Type:
boolean readonly
Implemented in:
ISaveToJSONOptions

Specifies how locale-specific strings are handled during JSON export.

Possible values:

  • true (default)
    Export the full JSON schema, including all locale strings. Use the locales array to restrict the output to specific locales.
  • false
    Export the JSON schema without any textual content.
  • "stringsOnly"
    Export a JSON schema that contains only locale strings and the minimal set of properties required to identify survey elements. Use the locales array to restrict the output to specific locales. To apply a locale-strings-only schema to a survey model, call the mergeLocalizationJSON(json, locales) method.

As an alternative to calling toJSON() with "stringsOnly", you can call the getLocalizationJSON(locales) method, which is syntactic sugar.

Type:
boolean | "stringsOnly" readonly
Implemented in:
ISaveToJSONOptions

Send feedback to the SurveyJS team

Need help? Visit our support page

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.