a!defaultValue( value, default )
Returns a default value when the specified value is null or empty. When there are multiple default parameters, each parameter is evaluated in order and the first non-null and non-empty default will be returned. Null
, ""
, and {}
are all considered null or empty values.
Keyword | Type | Description |
---|---|---|
|
Any Type |
Value to be returned if not null or empty. |
|
Any Type |
Default value to return when value is null or empty. |
Any Type
a!defaultValue("", null, "N/A")
returns "N/A"
.a!defaultValue({1, null, 3}, 4)
would return {1, null, 3}
.
a!defaultValue({null, null, null}, 3)
returns {null, null, null}
, and a!defaultValue({"", "", ""}, 3)
returns {"", "", ""}
.a!defaultValue({}, 3)
returns 3
.a!defaultValue(null, 1)
returns 1
a!defaultValue(1, “default”)
returns 1
a!defaultValue({}, "default")
returns "default"
a!defaultValue("", "default")
returns "default"
a!defaultValue(null, "")
returns ""
a!defaultValue(null, "", {})
returns {}
a!defaultValue({null, null, 1, null}, {2, 3, 4, 5})
returns {null, null, 1, null}
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | |
Process Reports | Incompatible | You cannot use this function to configure a process report. |
Process Events | Incompatible | You cannot use this function to configure a process event node, such as a start event or timer event. |
a!defaultValue Function