Mapping Methods Reference

Transform data using string, object, and array methods


tip
Check out the Connectors Mapping Playground to experiment with and troubleshoot mapping expressions.

This reference documents all available transformation methods in the Connectors mapping language. You use methods with the ->method syntax to manipulate strings, objects, arrays, and other data types. Each method accepts arguments that can be JSON literals (numbers, strings, booleans, arrays, objects, and null) or special variables like $, $args, $this, or $config.

See the common mapping patterns pages in the response mapping docs for example snippets of common transformations.

String methods

Method Description Example

slice

Returns a slice of a stringfirstTwoChars: countryCode->slice(0, 2)

size

Returns the length of a stringwordLength: word->size

Object methods

Method Description Example

entries

Returns a list of key-value pairskeyValuePairs: object->entries

size

Returns the number of properties in an objectpropCount: object->size

Array methods

Method Description Example

first

Returns the first value in a listfirstColor: colors->first

joinNotNull

Concatenates an array of string values using the specified separator and ignoring null values$(["a", "b", null, "c"])->joinNotNull(',')

last

Returns the last value in a listlastColor: colors->last

map

Maps a list of values to a new list, or converts a single item to a listcolors: colors->map({ name: @ })

slice

Returns a slice of a listfirstTwoColors: colors->slice(0, 2)

size

Returns the length of a listcolorCount: colors->size

Other methods

Method Description Example

echo

Evaluates and returns its first argumentwrappedValue: value->echo({ wrapped: @ })

jsonStringify

Converts a value to a JSON stringjsonBody: body->jsonStringify

match

Replaces a value with a new value if it matches another valuestatus: status->match([1, "one"], [2, "two"], [@, "other"])
Feedback

Ask Community