• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
    • Appendix
      • Appendix A - Installation
      • Appendix B - Keys Summary
      • Appendix C - Menu Summary
      • Appendix D - Toolbar Summary
      • Appendix E - Application Properties
      • Appendix F - Converting Within IMPS or ISSA
      • Appendix G - Errors in Censuses and Surveys
      • Appendix H - File Types
      • Appendix I - JSON Representations
        • Symbols
        • Case
        • JSON Serialization Options
        • CSPro ⇄ JSON Conversions: Binary Data
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

JSON Serialization Options

Overview
When serializing logic symbols, or case data, to JSON, the default settings used by CSPro are defined as part of application's JSON serialization properties. However, these settings can be overridden, generally by providing serializationOptions to one of the serialization routines (such as the Logic.getSymbolValue action).
Symbol Options
The following options control how some symbols are serialized. The default behavior is marked with ⁺⁺⁺.
Property NamePossible ValuesDescription
"ArrayFormat""full" ⁺⁺⁺
"sparse"
Determines how Array objects are written.
 
"binaryDataFormat""dataUrl"
"localhostUrl" ⁺⁺⁺
Determines how the data of binary logic objects and dictionary items is written, either as a data URL or as a localhost URL.
 
"HashMapFormat""array"
"object" ⁺⁺⁺
Determines how HashMap objects are written.
 
"jsonFormat""compact" ⁺⁺⁺
"pretty"
Determines if the JSON is written with no extra spacing (compact), or in a more readable format with spaces and newlines (pretty).
Case Options
The following options control how case data is serialized. The default behavior is marked with ⁺⁺⁺.
Property NamePossible ValuesDescription
"binaryDataFormat""dataUrl"
"localhostUrl" ⁺⁺⁺
Determines how the data of binary dictionary items is written, either as a data URL or as a localhost URL.
 
"writeFieldStatuses"true ⁺⁺⁺
false
If true, the entry status of fields in a data entry applications is written.
 
"writeLabels"true
false ⁺⁺⁺
If true, the value set label associated with the item is written along with the code.
Example
string caseJson = CS.Data.getCase(name := "JAMAICA_POP_DICT",
                                 
serializationOptions := @object "{ \"writeLabels\": true }");
See also: JSON Serialization Properties