FunctionCopy link to clipboard
true( returns )
Returns the Boolean value true
.
See also:
- if(): Evaluates a logical statement and returns different results if the logical statement returns
true
orfalse
. - false(): The opposite to the
true()
function; returns the boolean valuefalse
.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Boolean |
Returns the Boolean value |
ReturnsCopy link to clipboard
Boolean
Usage considerationsCopy link to clipboard
Using the true()
function is equivalent to using true
(without calling the function) in any expression. If calling the true()
function with parentheses, any parameters provided to the function are ignored.
In addition, it isn't necessary to compare a condition to true—the result of a conditional statement can be used directly.
For example, this expression will return "Yes"
:
1
2
3
4
5
if(
a!isUserMemberOfGroup(cons!MY_GROUP) = true(),
"Yes",
"No"
)
Copy
However, the following expression returns the same output:
1
2
3
4
5
if(
a!isUserMemberOfGroup(cons!MY_GROUP),
"Yes",
"No"
)
Copy
Tip: The true()
and false()
functions are commonly used with comparison or logical operators. See the expressions page for more examples.
ExamplesCopy link to clipboard
Basic exampleCopy link to clipboard
true()
returns true
Using true() as a Boolean statusCopy link to clipboard
1
2
3
4
5
6
7
8
9
10
11
12
a!localVariables(
local!status1: true(),
local!status2: false(),
local!status3: true(),
where(
{
local!status1,
local!status2,
local!status3
}
)
)
Copy
Returns {1, 3}
because the first and third status are true
.
Using true() for field configurationsCopy link to clipboard
Paste this example into an interface to see the result.
1
2
3
4
5
6
7
8
9
10
11
a!localVariables(
local!value,
a!textField(
label: "Text",
value: local!value,
saveInto: local!value,
required: true(),
characterLimit: 25,
showCharacterCount: true()
)
)
Copy
When configuring components, use true()
to set a fixed value for Boolean properties.
Feature compatibilityCopy link to clipboard
The table below lists this function's compatibility with various features in Appian.
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 | |
Process Autoscaling | Compatible |