- 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

Test Expression tab: toLowerCase(body) returns java for the message body 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

Test Expression tab: toLowerCase(context('id')) returns javascript for the context value 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

Test Expression tab: toLowerCase of a jsonPath result returns hello and world
jsonPath returns two values, and toLowerCase converts each one: two unique matches.

Notes

  • Use toLowerCase for case normalization: when systems log the same value in different cases, such as North and NORTH, toLowerCase(context('Region')) stores one spelling, north. toUpperCase does the same in uppercase.

Next Steps