• <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.updateValueFromJson Function

Format
b = symbol_name.updateValueFromJson(json);
Description
The Symbol.updateValueFromJson function updates the value of a symbol based on the symbol's JSON representation, passed to the function as the string expression json.
You can also use the Logic.updateSymbolValue action to update 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 a logical value of 1 (true) if the symbol's value was successfully updated from its JSON representation and 0 (false) otherwise.
Example
List string usmca_countries
usmca_countries.
updateValueFromJson("[ \"Canada\", \"Mexico\", \"United States\" ]");

// 3 countries are part of USMCA, including Canada and United States.
errmsg("%d countries are part of USMCA, including %s and %s.",
       usmca_countries.
length(),
       usmca_countries(
1), usmca_countries(usmca_countries.length()));
See also: Symbol.getJson Function, Symbol.getValueJson Function, Logic.updateSymbolValue Action