- 2 minutes to read

Formula - toLowerCase

The toLowerCase Formula function returns the content with every letter in lowercase.

Lowercase the customer name of an Order-to-Cash event with toLowerCase, then compare it without caring about case, animated walkthrough (7.12)
Animated walkthrough: on the JSON Order Received event of order ORD-10005 in the Order-to-Cash demo, toLowerCase(jsonPath('$.customer.name', body)) returns tailspin toys. Nested in equal, equal('tailspin toys', toLowerCase(jsonPath('$.customer.name', body))) returns true, whatever case the system logged.

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 (7.12)
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 (7.12)
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 (7.12)
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.
  • To compare without caring about case, lowercase the content first: equal('tailspin toys', toLowerCase(jsonPath('$.customer.name', body))). equal itself is case-sensitive.
  • toLowerCase follows the culture rules of the server, like toUpperCase.

Next Steps