- 2 minutes to read
Formula - toLowerCase
The toLowerCase Formula function returns the content with every letter in lowercase.
Syntax
toLowerCase(content)
Parameters
| Parameter | Required | Description |
|---|---|---|
content |
Yes | The text to convert: body, context, or the result of another function, such as jsonPath. |
Returns
The content in lowercase. When the content holds several values, each value is converted and returned as its own Search Field value. When the content has no value, nothing is returned.
Examples
Example 1: Lowercase the message body
Input
JAVA
Formula
toLowerCase(body)
Result
java

The whole message body is returned in lowercase.
Example 2: Lowercase a context property
Input
| Key | Value |
|---|---|
id |
JAVASCRIPT |
Formula
toLowerCase(context('id'))
Result
javascript

The value of the context property id is converted; the message body isn't used.
Example 3: Lowercase several values from a JSON body
Input
[
{ "name" :"HELLO"},
{"name" :"WORLD"}
]
Formula
toLowerCase(jsonPath('$..name',body))
Result
hello
world

jsonPath returns two values, and toLowerCase converts each one: two unique matches.
Notes
- Use
toLowerCasefor case normalization: when systems log the same value in different cases, such asNorthandNORTH,toLowerCase(context('Region'))stores one spelling,north. toUpperCase does the same in uppercase.