- 4 minutes to read

Formula - equal

Easily check if values are equal using the Nodinite equal Formula plugin. This page shows how to compare message Content, Context, or the output of other formulas, ensuring your integrations are accurate and reliable.

🎯 Designed for business users and integrators β€” no developer required; you can even use AI to craft expressions.

  • βœ… Instantly validate if values are equal for data consistency from any Payload or Context in any Log Event
  • βœ… Boolean result (true/false) for conditional logic and filtering
  • βœ… Transform and surface meaningful data in Nodinite Log Views, search filters, and self-service diagnostics
  • βœ… Combine with other Formula functions for powerful, layered expressions

What does the equal Formula do?

The equal(<Expression>, <Content>, ..., <Content>, <MatchAllValues>) Formula function checks whether two or more text values are equal. It returns true if the values match, and you can specify if all or just one value must match.


How it works: Input ➜ equal ➜ Result

graph LR A["Input: Values to compare"] --> B["equal('value', Content1, Content2, ...)"] B --> C["Result: true or false"]

Flow: Multiple values are compared against a specified expression, returning a boolean result.


Parameters

  • <Expression> – A string or expression to compare against
  • <Content> – One or more values to compare
  • <MatchAllValues> – Boolean (true or false). If true, all values must match; if false (default), only one match is required

Examples

Below are practical examples showing how to check if values are equal.

Example 1: Check if Message Body Equals Value

Input

GMT

Formula Expression

equal('GMT', body())

Result

true

equal_simpleParameter

Example: Checking if message body equals a value


Example 2: Check if Context Value Equals Value

Suppose you have a message context value with the key id containing GMT.

Input

GMT

Formula Expression

equal('GMT', context('id'))

Result

true

Simple equal_MessageContext

Example: Checking if context value equals a value


Example 3: Check if Result from Another Formula Equals Value

You can use the result of another formula function as input. For example, extracting values with regex and checking if they equal a specific value.

Input

GMT UTC

Formula Expression

equal('UTC', regex('GMT|UTC', body()))

Result

true

equal_nested_body

Example: Using another formula as input for equal

equal nested messageContext

Example: Using another formula as input for equal with message context


Features

The equal Formula function is highly flexible and can be nested with other formula functions. For instance, combine it with regex, jsonPath, or substring to validate extracted or transformed data.

  • Check if two or more values are equal for data validation
  • Returns boolean true or false for conditional logic
  • Option to require all values match or just one match
  • Works with message body, Context, or results from other Formula functions
  • Ensures data integrity across integrated systems

Important

The equal plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.


How to use

The equal formula validates if values match a specified expression. It's ideal for equality checks, data validation, or conditional filtering.

Syntax

equal('Expression', Content1, Content2, ..., MatchAllValues)

Parameters:

  • Expression (string): The value to compare against, e.g., 'GMT', 'Success', '200'
  • Content (string): One or more values to compare, typically from body() or context()
  • MatchAllValues (boolean, optional): If true, all values must match; if false (default), only one match is required

Common patterns:

  • equal('GMT', body()) – Check if body equals "GMT"
  • equal('Success', context('status')) – Validate status equals "Success"
  • equal('UTC', regex('GMT|UTC', body())) – Check if extracted value equals "UTC"

Use with different sources:

  • Check message body: equal('value', body())
  • Check message context: equal('value', context('MessageContextKey'))
  • Check formula result: equal('value', regex('pattern', body()))

Next step