Given a valid object key or array index, returns the value. If the value does not exist, a null string "" is returned. See “Using %Set(), %Get(), and %Remove()” for details and examples.
method %Get(key, default, type) as %RawString
parameters:
-
key — the object key or array index of the value to be retrieved. An array index must be passed as a canonical integer value. Array indexes begin at position 0.
-
default — optional value to be returned when the selected array element is undefined. Defaults to empty string if not specified.
-
type — if defined, indicates that the value of key should be returned as the specified type (see %DynamicObject.%Get()Opens in a new tab and %DynamicArray.%Get()Opens in a new tab for details on how values are converted). If this argument is specified, the value must be one of the following strings:
-
"" (empty string) — same as calling %Get(key) without conversions
-
"string" — convert to text string
-
"string>base64" — convert to text string then encode into base64
-
"string<base64" — convert to text string then decode from base64
-
"stream" — place string conversion into %Stream
-
"stream>base64" — string encoded into base64 into %Stream
-
"stream<base64" — string decoded from base64 into %Stream
-
"json" — convert to JSON representation
see also: %Set(), %Remove(), %Pop()
class reference: %DynamicObject.%Get()Opens in a new tab and %DynamicArray.%Get()Opens in a new tab