Formula - notequal
notequal('Expression',Content)
Formula function used to check if two strings (text) are not equal.
Quick example
Let's get you started with the following example: For other, and more advanced examples please scroll down on this page to the Examples section.
Input | Expression | Result |
---|---|---|
|
|
true |
Text Data | notequal expression | Unique values |
Features
- Check if two word/character are the not equal.
- Return Unique true when the compared text/string are different.
- Can be applied to any valid Content that returns text/string; Like jsonpath, xpath functions, review Formula user guide for the complete list of functions.
Important
This plugin loads the entire message into RAM, so make sure to apply this function only on small messages.
How to use
To use the notequal function, the Content parameter should contain text/string (otherwise it will fail and you will end up with a garbage result). But first and foremost we have to configure the Formula plugin:
- Select Formula as the expression type plugin.
- Write down the expression to use in the 'Expression' text area.
- Input proper Content as a parameter to the function.
Syntax
Use the notequal function with any of the following parameters:
From Message Body:
notequal('Expression', body)
From Message Context:
notequal('Expression',context('MessageContextKey'))
Result from previous Formula operation
notequal('Expression',SomeOtherNestedFormulaFunction(Content))
Examples
Below you will find different common examples of how to use the notequal function.
Body as Content
The message body is normal text "UTC", by using the provided expression, the result is true
.
Message Body
UTC
Expression
notEqual('GMT',body)
Context as Content
"UTC" is the Message context value and the key is "id", by using the provided expression, the result is true
.
e.g. notEqual('GMT', context('id'))
Message Context Value
UTC
Expression
notEqual('GMT', context('id'))
Formula Function as Content
Regex function has been used as a content parameter for notequal function, by using the provided expression, the result is true
.
e.g. notEqual('CET', regex('GMT|UTC', body))
Message Body
GMT UTC
Expression
notEqual('CET', regex('GMT|UTC', body))
Next Step
How to Add or manage Search Fields
How to Add or manage Log Views
Related
Expression Type Plugins are used in Search Fields
What are Search Fields?
What are Search Field Expressions?
What are Message Types?
What are Log Views?