and( value )
Returns true
if all inputs are true
; returns false
if at least one input is false.
See also:
and()
, but instead returns true if any of the values return true.and()
.Keyword | Type | Description |
---|---|---|
|
Boolean |
A value or array of values that must be true for the function to return true. |
Boolean
and()
evaluates.false
, the function returns false
. All values must be evaluated to true
to return true
.false
, evaluation of the later edge cases never occurs.and()
function. During troubleshooting, try evaluating each expression independently to identify issues.true
false
, but empty text strings in an array with multiple data types are considered null values and are filtered out before evaluation.and(true, true, false)
and({true, true, false})
Tip: The and()
function is often useful for validations to ensure that a value inputted by a user meets all of criteria.
and({})
returns true
and(1,2,"",3)
returns true
and(0,1,2,"",3)
returns false
because 0
casts to false
1
2
3
4
5
6
7
8
a!localVariables(
local!value: 123,
and(
local!value > 100,
local!value <= 200,
typename(typeof(local!value)) = "Number (Integer)"
)
)
Returns true
since the value provided passes all of the checks. The value provided is:
Paste the following example into an interface, and then select a Start Date and End Date to see how and()
is used to check both conditions for the end date.
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!startDate,
local!endDate,
{
a!dateField(
label: "Start Date",
value: local!startDate,
saveInto: local!startDate
),
a!dateField(
label: "End Date",
value: local!endDate,
saveInto: local!endDate,
validations: if(
and(
a!isNotNullOrEmpty(local!endDate),
local!endDate > today(),
local!endDate > local!startDate
),
"",
"Please enter a valid date. The end date must be after the start date and in the future"
)
)
}
)
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 |
and() Function