• <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
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
        • Symbol.getName Function
        • Symbol.getLabel Function
        • Symbol.getJson Function
        • Symbol.getValueJson Function
        • Symbol.updateValueFromJson Function
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Symbol.getValueJson Function

Format
s = symbol_name.getValueJson(ʃserializationOptions := serialization_optionsʅ);
Description
The Symbol.getValueJson function returns the JSON representation of a symbol's value. The optional serialization_options argument allows you to specify how the symbol should be serialized, potentially overriding the default application settings.
You can use the Symbol.getJson function if you want to work with the symbol's metadata, or both the metadata and value. You can also use the Logic.getSymbolValue action to get a symbol's value.
The following table describes the value-related serialization routines available for CSPro objects and contains links to the description of the JSON representation for each object.
Documentation about JSON representations feature will come in a future release. In the meantime you can see if the documentation is updated at:
https://www.csprousers.org/help/CSPro/symbols_json_representation.html
ObjectValue -> JSONJSON -> ValueJSON Representation
numeric✔✔
string, alpha✔✔
Array✔✔
Audio✔✔
Block
Dictionary✔
Document✔✔
File✔
Freq✔
function
Geometry✔✔
HashMap✔✔
Image✔✔
Item
List✔✔
Map
Pff
Record
Report
SystemApp✔✔
ValueSet✔✔
Return Value
The function returns the JSON representation of the symbol's value. If the function is called on a symbol that does not support the serialization of its value as JSON, a runtime error is issued and the function returns a blank string.
Example
List string usmca_countries = "Canada", "Mexico", "United States";
errmsg("%s", usmca_countries.getValueJson());
The JSON result may look similar to:
[
 
"Canada",
 
"Mexico",
 
"United States"
]
See also: Symbol.getJson Function, Symbol.updateValueFromJson Function, Logic.getSymbolValue Action