• <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
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
        • Logic Action Invoker Namespace
        • Logic.eval Action
        • Logic.getSymbol Action
        • Logic.getSymbolMetadata Action
        • Logic.getSymbolValue Action
        • Logic.invoke Action
        • Logic.updateSymbolValue Action
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Logic.updateSymbolValue Action

Format
CS.Logic.updateSymbolValue(name := ..., value := ...)
ArgumentDescriptionTypes / Required
nameThe name of the symbol.string
required
valueThe new value for the symbol.string, number, array, object
required
Description
The Logic.updateSymbolValue action updates the value of the symbol with the specified name to a new value specified using the symbol's JSON representation.
You can also use the Symbol.updateValueFromJson function 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 action returns undefined.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form, if no symbol has the specified name, or if the value is not specified in a way that can be converted to the symbol.
Example (JavaScript)
function sortList(symbolName) {
   
// get the List object from CSPro
    const list = CS.Logic.getSymbolValue({
        name: symbolName
    });

   
// sort the List, which is represented as an array
    list.sort();

   
// update the CSPro object
    CS.Logic.updateSymbolValue({
        name: symbolName,
        value: list
    });
}

sortList(
"usmca_countries");
See also: Logic Action Invoker Namespace, Logic.getSymbol Action, Logic.getSymbolMetadata Action, Logic.getSymbolValue Action, Symbol.updateValueFromJson Function