Boolean Functions
Boolean Functions in FlowOn Logic are built-in utilities that take one or more inputs, which may not necessarily be Boolean, and produce a Boolean result. These functions evaluate conditions, comparisons, or logical operations and return either 'true' or 'false' based on the defined criteria.
These Boolean functions fall under different categories, including Binary Logical Functions, Control Functions, and Unary Logical Functions, each serving specific purposes within the broader realm of Boolean logic.
Binary Logical Functions
Contains SubString
Return true if a string contains the specified substring; otherwise, it returns false.
ContainsSubString('<String>', '<Substring>')
| Parameter | Required | Type | Description |
|---|---|---|---|
| String | Yes | String | The String to check. |
| Sub String | Yes | String | The Sub String to find. |
| Return value | Boolean | true when the item is found. false when not found. |
Example 1
ContainsSubString("Hello World","Hello")
Result: trueExample 2
ContainsSubString("Hello World","Dynamics")
Result: false
Contains Item
Return true if a list contains the specified item; otherwise, it returns false.
ContainsItem([<Collection>], '<Item>')
| Parameter | Required | Type | Description |
|---|---|---|---|
| Collection | Yes | List | The list to check for the item. |
| Item | Yes | Any (String, Number ...) | The item to find in the list. |
| Return value | Boolean | true when the item is found. false when not found. |
Example 1
ContainsItem([1, 2, 3, 4, 5], 3)
Result: trueExample 2
ContainsItem(["apple", "banana", "cherry"], "grape")
Result: false
Does Not Contain Substring
Return true if a string does not contain the specified substring; otherwise, it returns false.
DoesNotContainSubString('<String>', '<Substring>')
| Parameter | Required | Type | Description |
|---|---|---|---|
| String | Yes | String | The String to check. |
| Sub String | Yes | String | The Sub String to find. |
| Return value | Boolean | true when the item is not found. false otherwise. |
Example 1
DoesNotContainSubString("FlowOn Logic takes Dynamics to the next level by eliminating the need to write code","Microsoft")
Result: trueExample 2
DoesNotContainSubString("Dynamics 365 is a Microsoft Solution", "Microsoft")
Result: false
Does Not Contain Item
Return true if the list does not contain the specified item; otherwise, it returns false.
DoesNotContainItem([<Collection>], '<Item>')
| Parameter | Required | Type | Description |
|---|---|---|---|
| Collection | Yes | List | The list to check for the item. |
| Item | Yes | Any (String, Number ...) | The item to find in the list. |
| Return value | Boolean | true when the item is not found. false otherwise. |
Example 1
DoesNotContainItem(["Product A", "Product B", "Product C"], "Product F")
Result: trueExample 2
DoesNotContainItem([55.9,21.6,12.8,75.4], 21.6)
Result: false
Does Not End With
Return true only if the provided text does not end with the characters you specify.
DoesNotEndWith("<String>", "<Characters>")
| Parameter | Required | Type | Description |
|---|---|---|---|
| String | Yes | String | The text to check. |
| Characters | Yes | String | The characters to check for absence at the end. |
| Return value | Boolean | true when the text does not end with the specified characters. false when it does. |
Example 1
DoesNotEndWith("FlowOn Logic", "End")
Result: trueExample 2
DoesNotEndWith("John02", "02")
Result: false
Does Not Start With
Return true only if the provided text does not start with the characters you specify.
DoesNotStartWith("<String>", "<Characters>")
| Parameter | Required | Type | Description |
|---|---|---|---|
| String | Yes | String | The text to check. |
| Characters | Yes | String | The characters to check for absence at the end. |
| Return value | Boolean | true when the text does not start with the specified characters. false when it does. |
Example 1
DoesNotStartWith("Hello World", "Hi")
Result: trueExample 2
DoesNotStartWith("Built in Functions", "Built")
Result: false
Ends With
Return true if the provided text ends with the characters you specify.
EndsWith("<String>", "<Characters>")
| Parameter | Required | Type | Description |
|---|---|---|---|
| String | Yes | String | The text to check. |
| Characters | Yes | String | The characters to check for at the end of the text. |
| Return value | Boolean | true when the text ends with the specified characters. false when it doesn't. |
Example 1
EndsWith("Lebanon", "on")
Result: trueExample 2
EndsWith("Saudi Arabia", "Sau")
Result: false
Is Equal To
Return true if both operands are equal; otherwise, it returns false.
IsEqualTo(<Operand1>, <Operand2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand1 | Yes | Any | The first operand to compare. |
| Operand2 | Yes | Any | The second operand to compare. |
| Return value | Boolean | true when both operands are equal. false when they are not. |
Example 1
IsEqualTo(10, 10)
Result: trueExample 2
IsEqualTo("2023-09-01 15:30:00", "2023-09-02 10:45:00")
Result: false
Is Greater Than
Returns true if the first operand is greater than, but not equal to, the second operand; otherwise, it returns false
IsGreaterThan(<Operand1>, <Operand2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand1 | Yes | Numeric (Integer, Decimal, Float, Money) | The first operand to compare. |
| Operand2 | Yes | Numeric (Integer, Decimal, Float, Money) | The second operand to compare. |
| Return value | Boolean | true when Operand1 is greater than Operand2. false when they are equal or Operand1 is less than Operand2. |
Example 1
IsGreaterThan(10, 4)
Result: trueExample 2
IsGreaterThan(13.5,24.5)
Result: false
Is Greater Than Or Equal To
Returns true if the first operand is greater than,or equal to the second operand; otherwise, it returns false
IsGreaterThanOrEqualTo(<Operand1>, <Operand2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand1 | Yes | Numeric (Integer, Decimal, Float, Money) | The first operand to compare. |
| Operand2 | Yes | Numeric (Integer, Decimal, Float, Money) | The second operand to compare. |
| Return value | Boolean | true when Operand1 is greater than or equal to Operand2. false when Operand1 is less than Operand2. |
Example 1
IsGreaterThanOrEqualTo(10, 10)
Result: trueExample 2
IsGreaterThanOrEqualTo(12.5,22.5)
Result: false
Is Less Than
Returns true if the first operand is less than, but not equal to, the second operand; otherwise, it returns false
IsLessThan(<Operand1>, <Operand2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand1 | Yes | Numeric (Integer, Decimal, Float, Money) | The first operand to compare. |
| Operand2 | Yes | Numeric (Integer, Decimal, Float, Money) | The second operand to compare. |
| Return value | Boolean | true when Operand1 is less than Operand2. false when they are equal or Operand1 is greater than Operand2. |
Example 1
IsLessThan(2, 5)
Result: trueExample 2
IsLessThan(44.6,10.3)
Result: false
Is Less Than Or Equal To
Returns true if the first operand is less than, or equal to, the second operand; otherwise, it returns false
IsLessThanOrEqualTo(<Operand1>, <Operand2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand1 | Yes | Numeric (Integer, Decimal, Float, Money) | The first operand to compare. |
| Operand2 | Yes | Numeric (Integer, Decimal, Float, Money) | The second operand to compare. |
| Return value | Boolean | true when Operand1 is less than or equal to Operand2. false when Operand1 is greater than Operand2. |
Example 1
IsLessThanOrEqualTo(5.32, 5.32)
Result: trueExample 2
IsLessThanOrEqualTo(15, 5)
Result: false
Is Not Equal To
Returns true if both operands are not equal; otherwise, it returns false
IsNotEqualTo(<Operand1>, <Operand2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand1 | Yes | Numeric (Integer, Decimal, Float, Money) | The first operand to compare. |
| Operand2 | Yes | Numeric (Integer, Decimal, Float, Money) | The second operand to compare. |
| Return value | Boolean | true when Operand1 is not equal to Operand2. false when they are equal. |
Example 1
IsNotEqualTo(22,11)
Result: trueExample 2
IsNotEqualTo(15, 15)
Result: false
Starts With
Returns true if the provided text starts with the characters you specify; otherwise, it returns false.
StartsWith("<String>", "<Characters>")
| Parameter | Required | Type | Description |
|---|---|---|---|
| String | Yes | String | The text to check. |
| Characters | Yes | String | The characters to check for at the beginning of the text. |
| Return value | Boolean | true when the text starts with the specified characters. false when it doesn't. |
Example 1
StartsWith("Lebanon", "Leb")
Result: trueExample 2
StartsWith("Saudi Arabia", "Arab")
Result: false
Control Functions
AND
The AND operator specifies that all statements must be true for the expression to evaluate as true.
<Condition1> AND <Condition2>
| Operator | Description |
|---|---|
| AND | Specifies that both Condition1 and Condition2 must be true for the expression to evaluate as true. |
- Example 1
(ContainsSubString("Hello World","Hello") AND IsEqualTo(10, 10)) Result: true
- Example 2
```csharp
(IsGreaterThan(55.2,24.5) AND StartsWith("Saudi Arabia", "Arab"))
Result: false
OR
The OR operator specifies that any of the OR statements can be correct for the expression to evaluate as true.
<Condition1> OR <Condition2>
| Operator | Description |
|---|---|
| OR | Specifies that either Condition1> or Condition2 (or both) must be true for the expression to evaluate as true. |
- Example 1
(IsGreaterThan(55.2,24.5) OR IsLessThan(32, 5))
Result: true
- Example 2
```csharp
(IsGreaterThan(1,4) OR IsLessThan(32, 5))
Result: false
If Condition
The If Condition function returns a designated value if the condition evaluates as true, and a different value if it evaluates as false.
If(<Condition>, <TrueValue>, <FalseValue>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Condition | Yes | Boolean | The condition to evaluate. |
| TrueValue | Yes | Any | The value to return if the condition is true. |
| FalseValue | Yes | Any | The value to return if the condition is false. |
| Return value | Any | The value returned based on the evaluation of the condition. |
- Example
If(DoesNotStartWith("Hello World", "Hi"), "The provided text does not start with Hi", "The provided text starts with Hi")
Unary Logical Functions
Has Any Value
Return true if the provided list contains at least one non-null value.
HasAnyValue([<Collection>])
| Parameter | Required | Type | Description |
|---|---|---|---|
| List | Yes | List | The list to check for non-null values. |
| Return value | Boolean | true when the list contains at least one non-null value. false when the list is empty or contains only null values. |
- Example 1
HasAnyValue([1, null, 3, null])
Result: true
- Example 2
HasAnyValue([null, null, null, null])
Result: false
Is False
Return true if the operand evaluates to false, otherwise, it returns false
IsFalse(<Operand>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand | Yes | Boolean | The operand to evaluate. |
| Return value | Boolean | true when the operand evaluates to false. false when the operand evaluates to true. |
- Example 1
IsFalse(IsLessThan(12,4))
Result: true
- Example 2
IsFalse(IsLessThan(2,4))
Result: false
Is True
Return true if the operand evaluates to true, otherwise, it returns false
IsTrue(<Operand>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand | Yes | Boolean | The operand to evaluate. |
| Return value | Boolean | true when the operand evaluates to true. false when the operand evaluates to false. |
- Example 1
IsTrue(IsEqual(12,12))
Result: true
- Example 2
IsTrue(IsEqual(2,4))
Result: false
Not Null
Return true if an operand is NOT null, otherwise, it returns false
NotNull(<Operand>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand | Yes | Boolean | The operand to evaluate. |
| Return value | Boolean | true when the operand is not null. false otherwise |
- Example 1
NotNull(HasAnyValue([55, 12, 3, null]))
Result: true
- Example 2
NotNull(HasAnyValue([null, null]))
Result: false
Null
Return true if an operand is null, otherwise, it returns false
Null(<Operand>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand | Yes | Boolean | The operand to evaluate. |
| Return value | Boolean | true when the operand is null. false otherwise |
- Example 1
Null(HasAnyValue(["Elie", "Mohammed", "Ali", null]))
Result: false
- Example 2
Null(HasAnyValue([null, null]))
Result: true
Not Null Or Empty String
Return true only if a text operand is NEITHER null nor empty, otherwise, it returns false
NotNullOrEmptyString(<Operand>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand | Yes | Boolean | The operand to evaluate. |
| Return value | Boolean | true when the a text operand is not null nor empty. false otherwise |
- Example 1
NotNullOrEmptyString("John Doe")
Result: true
- Example 2
NotNullOrEmptyString("")
Result: false
Null Or Empty String
Return true only if a text operand is NEITHER null nor empty, otherwise, it returns false
NullOrEmptyString(<Operand>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Operand | Yes | Boolean | The operand to evaluate. |
| Return value | Boolean | true when the a text operand is null or empty. false otherwise |
- Example 1
NullOrEmptyString("Ayla Doe")
Result: false
- Example 2
NullOrEmptyString("")
Result: true
What's Next
In this section, we've explored various boolean functions in FlowOn logic and learned how to apply them effectively. In the next section, we'll delve into Text functions for further understanding and application.