Logic and comparisons
Compare values, combine conditions and pick a value depending on a condition.
Equals
Checks whether two values are equal.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| A | Text | Yes | First value. |
| B | Text | Yes | Second value. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if a equals b. |
Equals (number)
Checks whether two numbers are equal (numeric comparison, unlike Equals which compares text).
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| A | Decimal number | Yes | First number. |
| B | Decimal number | Yes | Second number. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if a equals b numerically. |
Not equals
Checks whether two values differ.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| A | Text | Yes | First value. |
| B | Text | Yes | Second value. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if a does not equal b. |
Greater than
Checks whether a is greater than b.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| A | Decimal number | Yes | First value. |
| B | Decimal number | Yes | Second value. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if a > b. |
Less than
Checks whether a is less than b.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| A | Decimal number | Yes | First value. |
| B | Decimal number | Yes | Second value. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if a < b. |
Greater or equal
Checks whether a is greater than or equal to b.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| A | Decimal number | Yes | First value. |
| B | Decimal number | Yes | Second value. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if a >= b. |
Less or equal
Checks whether a is less than or equal to b.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| A | Decimal number | Yes | First value. |
| B | Decimal number | Yes | Second value. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if a <= b. |
Logical AND
Returns true only if every value is true.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Values | List of Yes/No | Yes | Yes/No values to combine. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if all values are true. |
Logical OR
Returns true if at least one value is true.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Values | List of Yes/No | Yes | Yes/No values to combine. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if any value is true. |
Logical NOT
Inverts a yes/no value.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Value | Yes/No | Yes | Yes/No value to invert. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | The inverted yes/no value. |
If/else value
Returns one of two values depending on a condition (ternary).
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Condition | Yes/No | Yes | Yes/No condition to evaluate. |
| Value type | Kind of value | No | Optional data type for the two values and the result (defaults to text when left empty). |
| Value if true | Matching value | Yes | Returned when the condition is true. |
| Value if false | Matching value | Yes | Returned when the condition is false. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Matching value | Either value-if-true or value-if-false. |
Match value
Looks a value up in a list of cases and returns the result that case stands for, or the fallback when nothing matches. Use this instead of a long chain of if/else values or a switch whose branches only set one value.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Value to match | Any | Yes | The value to look up. Numbers and yes/no values are matched by their text form; a user, role or channel is matched by its id. |
| Value type | Kind of value | No | Optional data type of the returned value (defaults to text when left empty). |
| Cases | Lookup table of Text to Any | Yes | The lookup table: each entry's key is a value to match, each entry's value is what to return for it. |
| Fallback | Matching value | No | Returned when no case matches. Left empty this returns nothing. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Matching value | The matching case's value, or the fallback. May be empty. |
| Matched | Yes/No | True when a case matched, false when the fallback was used. |
Is empty
Checks whether a value is empty.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Value | Any | Yes | Value to check. |
Outputs
| Name | Type | Details |
|---|---|---|
| Is empty | Yes/No | True when the value is empty. |
Use a fallback when empty
Passes the value on, or the fallback when the value is empty (an empty text or list still counts as set). The result is never empty, so steps after it get no "may be empty" warning.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Value | Any | Yes | The value to use when it is set. |
| Fallback | Any | Yes | Used instead when the value is empty (an empty text or list still counts as set). Must be the same kind of value. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Any | The value, or the fallback when the value was empty. |
Turn text into a choice
Finds the value of a choice list that a text names, for example a typed answer or a command option. An exact match wins, then one that ignores spaces around the text and upper or lower case. Special letters such as ß and the dotted İ are matched exactly, so Straße does not match STRASSE. When nothing matches you get the fallback, or no value.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Text | Text | Yes | The text to look up in the choice list. |
| Choice list | Choice list | Yes | The choice list whose values the text is matched against. |
| Fallback | Choice | No | The choice to use when the text matches no value. Leave it empty to get no value instead. |
Outputs
| Name | Type | Details |
|---|---|---|
| Choice | Choice | The matching value of the choice list, or the fallback. Empty when nothing matches and there is no fallback. May be empty. |
| Matched | Yes/No | Yes when the text matched a value of the choice list. |
Has a value
Checks whether a value is present. Returns true when the value resolves to something other than nothing or an empty text or list. The friendly inverse of "Is empty".
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Value | Any | Yes | Value to check. |
Outputs
| Name | Type | Details |
|---|---|---|
| Has a value | Yes/No | True when the value is neither missing nor an empty text or list. |
Is one of
Checks whether a value is one of the values you list out. This is how you test a fixed choice such as a channel's type, which a plain "Equals" cannot compare at all. Matching is exact and server objects match by id, so 5 and "5" are not the same value. An empty value never matches, and an empty list matches nothing.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Value | Item | Yes | The value to test. Connect something here first: the list below then offers exactly the values its type allows. |
| One of | List of Any | Yes | The values that count as a match. An empty list matches nothing. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True when the value is one of the listed values. |
Text to yes/no
Reads a yes/no value from text. Returns an empty value if not recognized.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Text | Text | Yes | The text to read (e.g. true/false, yes/no). |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | The yes/no value, or empty. May be empty. |