data.GetValue
This function returns the value from the mapping reference. If it is not defined, it returns the default value specified by the user.
Syntax
data.GetValue(mappingReference, default)
Arguments
Argument |
Type |
Description |
---|---|---|
mappingReference |
Any |
Variable name or path. For example:
|
default |
Any |
The default value specified by the user. If the mapping reference is not defined, this default value is returned. |
Returns
Type |
Description |
---|---|
Any |
The value of the mapping reference or default value |
Examples
-
If
$Activity[foo].book[2].price
is equal to30
, the functionGetValue($Activity[foo].book[2].price, 90)
returns30
. - If
$.foo.store.addr
is not defined, the functionGetValue($.foo.store.addr, "Some address")
returns "Some address
".