Moveworks Data Mapper Common Examples
Overview
These examples show how to shape real API payloads into the readable, well-formed data a plugin needs. Each one gives you a payload, the mapping that transforms it, and the exact result that mapping produces, so you can adapt a working starting point rather than build from the operator reference.
For the full catalog of operators, see the Data Mapper / JSON Bender Reference. For a broader library of task-oriented recipes covering dates, conditionals, lookups, and dynamic URLs, see Common DSL & Mapper Patterns.
Reading the syntax on this page
The mappings below mix two related languages, and knowing which one you are looking at makes them much easier to read.
Operators are the NAME(): keys, such as MAP(), SORT(), and EVAL(). They are the structural layer: they build objects and lists, loop, and branch. Operator names are always uppercase and always end in ().
DSL functions are the $-prefixed calls that appear inside an expression, such as $CONCAT and $FILTER. They transform values. Every DSL function can be written as either $FUNC(items, arg) or items.$FUNC(arg), and lambdas use arrow syntax — x => x != null. The DSL Reference documents all of them.
Two details account for most early confusion:
- A bare string is an expression, not a literal.
sp_title: data.titlereads thetitlefield. To assign the literal textComplete, quote it twice —status: '"Complete"'— because the outer quotes belong to YAML and the inner quotes make it a string in the expression. - Some names exist in both languages with different behavior.
CONCAT()the operator and$CONCATthe DSL function are not the same thing, and they differ in how they treat empty values. Check which layer you are in before reusing a name.
Examples
Display a list of items in a single field
Ticketing and request-management payloads often return a list of related records — approvers, tasks, watchers — when what you want to show the user is a single readable line. This example aggregates the name of every approver into one comma-separated field called approvers.
Context
The API returns an array of approver objects, each with a name, email, and external identifier. The goal is one string listing every approver name.
Given Payload Response
Bender Mapping
MAP() pulls item.name out of each object to produce a list of names, then $CONCAT joins that list into one string.
JSON
YAML
Expected Result
$CONCAT inserts the separator exactly as you write it. It never adds a space of its own, so the separator ',' produces "John Doe,Jane Smith,Alex Johnson". Include the space in the separator — ', ' — when you want one.
Simpler alternative
Because $MAP and $CONCAT both exist as DSL functions, you can chain them in a single expression and skip the MAP() operator and args block entirely:
This produces the same result. Reach for the operator form when a step needs to build a nested object or list, and the DSL form when you are only transforming values.
Return unique elements from an array
Duplicate values in a payload lead to repeated rows in a display record or redundant items in a downstream request. This example removes duplicates from an array and returns only the distinct values.
Context
The API returns an array whose values may repeat. The goal is the same array with every duplicate removed.
There is no $UNIQUE function in the language, so deduplication is done in two steps: sort the values so duplicates become adjacent, then keep only the values that differ from the one before them.
Given Payload Response
Bender Mapping
SORT() groups equal values together. $FILTER then walks the sorted list and keeps an element when it is the first one (i == 0) or when it differs from its predecessor.
JSON
YAML
Expected Result
In a $FILTER lambda the first parameter is always the value and the second is the index, so (x, i) reads as “value, index”. The sorted list is still reachable by name inside the expression, which is what makes sorted_records[i - 1] possible.
This pattern works on lists of primitives — numbers, text, booleans. It fails on a list of objects, because SORT() cannot order objects and != compares them structurally. To deduplicate objects, map them down to the single scalar you want to be unique first.
Remove empty keys from the output mapper in a return statement
APIs frequently return fields as null, or omit them entirely. Passing those keys into a return statement gives the LLM empty context to reason over, and many APIs reject request bodies that contain null fields. This example builds an object and strips the empty keys out of it before returning.
Context
A Microsoft Graph system returns purchase-order information, and you want to return only a few of its fields from an Agentic Automation plugin. Some of those fields are null or missing on any given record.
Given Payload Response
Bender Mapping
Build the object you want inside args, then run $FILTER over it in expression. $FILTER keeps the entries whose value satisfies the lambda and returns an object of the same shape, minus the dropped keys.
Expected Result
args supplies the data the expression runs against — it is scoping input, not part of the result. The output is whatever expression evaluates to, so the filtered object is returned directly and there is no sharepoint_info key wrapping it.
$FILTER(x => x) filters on truthiness, not on emptiness. It removes null, and it also removes 0, false, "", [], and {}. A legitimate zero quantity or a false flag disappears along with the nulls.
To remove only null and keep every other value, compare against null explicitly:
Against the payload above, this returns sp_title and sp_status and drops sp_user, but it would preserve a 0 or a false.