Formula - Count
TIP: An example of real-life usage, use the Count function to get an alert if an order has less (or more) then X order rows
Let's get you started with the following example. For other and more advanced examples, scroll down on this page to the Examples section.
|Text Data||count expression||Unique values|
count( ) function can be used on any content, as long as data is returned from the
Content part. It doesn't matter if the content parameter a plain text or any valid Formula Plugin function. Please notice that the number returned represents the unique count of the extracted values; more on this later below.
- Return the count of extracted values from the Content.
- It returns the count of the unique values from Content
- It can be applied on the Content part that returns data; Like jsonpath, xpath functions or even a plain-text, review the Formula user guide for the complete list of functions.
This plugin loads the entire message into RAM, so make sure to apply this function only on small messages..
The Content part should contain data to use the count function, (otherwise, it will fail, and you will end up with nothing as the result). But first and foremost, you must configure the Formula plugin:
- Select Formula as expression type plugin.
- Write down the expression to use in the 'Expression' text area.
- Input Content as a parameter to the function.
Use the count function with any of the following parameters:
From Message Body:
From Message Context:
Result from previous Formula operation
Below, you will find different common examples of how to use the count function.
"Nodinite" is the message body text; By using the provided expression, the result is
"Nodinite" is the value for the corresponding key "id", by using the provided expression, the result is
The message body is a JSON structure, and by using the provided expression, the result is