or( value )
Returns true
if any inputs are true
; returns false
if all inputs are false
.
See also:
or()
, but instead returns true
if all of the input values return true
.true
. This function is a combination of a!forEach() and or()
.Keyword | Type | Description |
---|---|---|
|
Boolean |
A value or array of values that must be false for the function return false. |
Boolean
or()
evaluates.true
, the function returns true
. All values must evaluate to false
for the function to return false
.true
, evaluation of the later edge cases never occurs.or()
function. During troubleshooting, try evaluating each expression independently to identify issues.false
.true
, but empty text strings in an array with multiple data types are considered null values and are filtered out before evaluation.or(true, true, false)
or({true, true, false})
Tip: The or()
function is useful within a component's showWhen parameter. This allows you to display the component if any of the conditions return true
.
or({})
returns false
or(1,2,"",3)
returns true
or(0,1,2,"",3)
returns true
1
2
3
4
5
6
7
a!localVariables(
local!date: date(2022, 1, 2),
or(
calisworkday(local!date),
local!date > today()
)
)
This returns false
because 2 Jan 2022 is a date in the past and it is not a work day in the default calendar.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
a!localVariables(
local!selection,
local!description,
{
a!radioButtonField(
label: "Approved",
choiceLabels: {"Yes", "No"},
choiceValues: {"Yes", "No"},
value: local!selection,
saveInto: local!selection
),
a!paragraphField(
label: "Comments",
value: local!description,
saveInto: local!description,
showWhen: or(
a!isUserMemberOfGroup(
username: loggedInUser(),
groups: cons!MY_GROUP_SUPERVISOR
),
local!selection = "No"
)
)
}
)
The paragraph field is only displayed if the user is in the supervisors group or they have selected No
in the radio button selection.
1
2
3
4
5
6
7
8
9
10
11
12
a!localVariables(
local!response: rule!MY_IntegrationRule(),
if(
or(
a!isNullOrEmpty(local!response),
local!response.success = false,
local!response.result.body.totalCount = 0
),
"Error Occurred",
"Total Results: " & local!response.result.body.totalCount
)
)
In this example, the results of an integration are stored in local!response
. We'd like to return the total number of results, but there are several possible error scenarios. If any of the following occur, we should provide a generic error message:
false
, which often occurs when an integration returns a 500 or 404 error.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 | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Compatible | |
Process Events | Compatible |
or() Function