Dictionary functions
A set of functions for working with dictionaries.
Dictionary
This function has 2 signatures:
Dictionary([name1, value1, ..., nameN, valueN]?) -> Dictionary
Function bundle: Core
Returns a new dictionary based on the provided arguments. The arguments are name/value pairs. e.g. dictionary('field1',val,'field2',val2,...).
Parameter
- [name1, value1, ..., nameN, valueN] (Optional): Any - Ongoing name/value pairs.
Return value: Dictionary
Example
prints 3
Dictionary(jsonText) -> Dictionary
Function bundle: Core
Deserializes JSON text as an Arcade Dictionary.
Parameter
- jsonText: Text - The JSON to convert to an Arcade dictionary. This must be serialized as a text value.
Return value: Dictionary
Example
Deserializes JSON as a Dictionary.
FromJSON
FromJSON(jsonText) -> Dictionary | Array<Any> | Text | Boolean | Number
Function bundle: Core
Deserializes JSON text into its equivalent Arcade data types.
Parameter
- jsonText: Text - The JSON text to deserialize to an Arcade data type.
Return value: Dictionary | Array<Any> | Text | Boolean | Number
Examples
Converts text to a boolean
Converts text to a number
Converts text to a dictionary
Converts text to an array
Converts text to null
HasKey
HasKey(value, key) -> Boolean
Function bundle: Core
Indicates whether a dictionary or feature has the input key.
Parameters
- value: Dictionary | Feature - The dictionary or feature to check for a key or field name.
- key: Text - The key or field name to check.
Return value: Boolean
Example
prints true
HasValue
HasValue(inputDictionary, key) -> Boolean
Function bundle: Core
Indicates whether a dictionary has a given key and if that key has a value.
Parameters
- inputDictionary: Dictionary | Feature - The dictionary or feature to check.
- key: Text - The key or field name to check.
Return value: Boolean
Examples
Dictionary with key that has a value
Dictionary with key that does not have a value
Dictionary without the provided key
Dictionary without the provided key