You are here:
Omnistudio Conditional Functions
Functions that perform conditional operations.
- Omnistudio IF Function
Evaluates an expression to determine whether it's true or false and returns the indicated response. If the expression evaluates to true, the function returns the true (first) result. Otherwise, the function returns the false (second) result. - Omnistudio ISBLANK Function
Returns true if an expression is blank or empty. Otherwise, the function returns false. - Omnistudio ISNOTBLANK Function
Returns true if an expression is not blank or empty. Otherwise, the function returns false.
Omnistudio IF Function
Evaluates an expression to determine whether it's true or false and returns the indicated response. If the expression evaluates to true, the function returns the true (first) result. Otherwise, the function returns the false (second) result.
Both the true and false branches are always evaluated and it returns the result of the false
branch. This becomes significant when either branch contains operations with side effects (such
as InvokeIP, , DML operations, or callouts), because actions in the true
branch may still execute even when the condition is false.
For example:
IF(
ISNOTBLANK(Account.Id),
InvokeIP(
'AccountCreateIP_AccountCreateIP',
INPUT('SomeKey', 'SomeVal'),
'OutputKey'
),
'IP Not Called'
)In this example, even if Account.Id is blank (which should lead
to returning "IP Not Called"), the InvokeIP function in the
true branch is still evaluated.
Signature
IF(expression, trueResult,
falseResult)
Return Value
Any data type
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
Expression |
Required |
An expression that resolves to true or false. |
|
Expression |
Required |
An expression that resolves to the value to be returned if the expression parameter is true. |
|
Expression |
Required |
An expression that resolves to the value to be returned if the expression parameter is false. |
Formula: IF(("abc" LIKE "a"), "true", "false")
Return value: "true"
Formula: IF(("a" LIKE "abc"), "true", "false")
Return value: "false"
Sample data: InputDate: "1999-07-01"
Formula: IF(InputDate < "2000-01-01", "20th Century", "21st Century")
Return value: "20th Century"
Sample data: "Price": "$800.00"
Formula: IF(SUBSTRING(Price, 0, 1) == "$", SUBSTRING(Price, 1), Price)
Return value: "800.00"
Sample data: "Amount": 2
Formula: IF(Amount > 0, 1 / IF(Amount > 0, Amount, 1), 0)
Return value: 0.5
Sample data: "Amount": 0
Formula: IF(Amount > 0, 1 / IF(Amount > 0, Amount, 1), 0)
Return value: 0
Sample data: "Amount": 0
Formula: IF(Amount > 0, 1 / IF(Amount > 0, Amount, 1), "Undefined")
Return value: "Undefined"
Omnistudio ISBLANK Function
Returns true if an expression is blank or empty. Otherwise, the function returns false.
Signature
ISBLANK(expression)
Return Value
Boolean
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String or list |
Required |
An expression that resolves to a string or list to determine whether it is empty. |
Formula: ISBLANK("")
Return value: true
Formula: ISBLANK(())
Return value: true
Formula: ISBLANK([])
Return value: true
Sample data: "EmptyList": []
Formula: ISBLANK(%EmptyList%)
Return value: true
Omnistudio ISNOTBLANK Function
Returns true if an expression is not blank or empty. Otherwise, the function returns false.
Signature
ISNOTBLANK(expression)
Return Value
Boolean
Parameters
Parameter |
Data Type |
Necessity |
Description |
|---|---|---|---|
|
String or list |
Required |
An expression that resolves to a string or list to determine whether it is not empty. |
Formula: ISNOTBLANK('Hello world')
Return value: true
Formula: ISNOTBLANK(("a", "b"))
Return value: true
Formula: ISNOTBLANK([1, 2])
Return value: true
Sample data: "NumberList": [1, 2]
Formula: ISNOTBLANK(%NumberList%)
Return value: true

