Formula - Convert Case

toUpperCase & toLowerCase.

Both are simple and straightforward functions, the Content parameter could be simple as "body" or more advance and powerful such as regex() , jsonpath() or any Formula Plugin function.

toUpperCase

Description

toUpperCase( ) is used to convert the text letters to capital(Known as UpperCase).

Syntax

On the Message Body :

toUpperCase(body)

On the Message Context :

toUpperCase(context('MessageContextKey'))

Some operations on the Message Body :

1.Simple toUpperCase body Parameter

Example: "body" is the body parameter. if "gmt" is the body content , the result will be "GMT" capital letters. 	

Test Expression

e.g. toUpperCase(body)

Simple toUpperCase test


2.Nested regex( ) as body parameter

Example: The body is normal text,thereby, regex function could be used as a Content parameter of toUpperCase function to extract the desired content from the body(Using any valid Regular Expression)and convert the extracted match text to capital letters.

Test Expression

e.g. toUpperCase(regex('gmt|utc',body))

toUpperCaseWithRegex


Some operations on the Message Context :

1.Simple toUpperCase as Context parameter

Example: if "gmt" is the Message context value and the key is "id" , the result will be "GMT". 	

Test Expression

e.g. toUpperCase(context('id'))

Simple toUpperCase test


2.Nested regex( ) as context parameter .

Example: Regex function used as context parameter of toUpperCase function in order to extract the desired content from the context value(Using any valid Regular Expression)and convert the extracted match text to capital letters.

Test Expression

e.g. toUpperCase(regex('gmt|utc', context(regex('id.*'))))

toUpperCaseWithRegex


toLowerCase

Description

toLowerCase( ) is the opposite implementation of toUppercase , its used to convert all the text letters to small(known as LowerCase).

Syntax

On the Message Body :

toLowerCase(body)

On the Message Context :

toLowerCase(context('MessageContextKey'))

Some operations on the Message Body and Message Context :

Resemble the implementation of toUpperCase( ) , same syntax and same body parameter structure.