NOT
Use the NOT function when you want to make sure one Logical value is not equal to another.
Use
NOT( logical )
Reverses a logical value.
| Parameter | Required | Description |
|---|---|---|
| logical | Yes | a value or condition that can be evaluated to TRUE or FALSE |
| Returns | Logical |
Examples
Character Restriction in Form Validation
You can use the NOT function in an Output Validation formula to ensure a user does not enter prohibited characters into a text field.
- Scenario: You have a "Username" field that must not contain any spaces.
- Formula:
ASSERT(NOT(REGEX_MATCH(this, " ")), "Usernames cannot contain spaces."). - Logic:
REGEX_MATCH(this, " "): This part of the formula returns TRUE if a space is found in the current text.NOT(...): TheNOTfunction reverses that result. If a space is found (TRUE),NOTmakes the result FALSE.ASSERT: In GoApprove validation, a FALSE result triggers the error message, informing the user that spaces are disallowed.
Conditional Path Routing Based on Status
The NOT function can be used in a Path Condition formula to route an approval based on whether a previous activity was not successful.
- Scenario: A workflow includes a "Safety Inspection" activity. If the inspection is not completed (e.g., it was cancelled or expired), the workflow should follow a "Failure Log" path.
- Formula:
NOT(@SafetyInspection.prop.Completed). - Logic:
@SafetyInspection.prop.Completed: This system property returns TRUE if the activity was finished and FALSE otherwise.NOT(...): If the activity is incomplete (FALSE), theNOTfunction turns it into TRUE.- Result: Because the path condition is now TRUE, the branch follows the designated path for incomplete inspections.