Argument | Description | Types / Required |
name | The name of the symbol. | string
required |
serializationOptions | Options for how the symbol should be serialized. | object
not required |
You can use the
Logic.getSymbolMetadata action if you only want to work with the symbol's metadata, or
Logic.getSymbolValue if you only want the symbol's value. You can also use the
Symbol.getJson function to get a symbol's JSON metadata and value.
All symbols support the serialization of the symbol metadata. 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:
The action returns an object with the symbol's metadata and, if applicable, the JSON representation of the value.
The action throws an exception if any of its arguments are not specified in a valid form or if no symbol has the specified name.
// proceed only if the dictionary is the main input dictionary and a case exists
const precipitationDict = CS.Logic.getSymbol({
name: "PRECIPITATION_DICT"
});
if( precipitationDict.type != "Dictionary" || precipitationDict.dictionaryType != "input" ) {
throw new Error(`${precipitationDict.name} is not the main dictionary.`);
}
if( precipitationDict.value == undefined || precipitationDict.value.case == undefined) {
throw new Error(`${precipitationDict.name} is not currently associated with a case.`);
}