For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
DeveloperAcademyCommunityStatus
  • Service Management
    • Overview
    • Concierge & Ticketing Capabilities Overview
    • Forms
    • Forms - Integration Specific Guides
    • Live Agent Chat / Handoff
    • Triage
    • Approval Mirroring
    • Ticket Interception
    • Generic Ticketing Integration: Ticket Gateway
  • Administration
    • MyMoveworks
    • Organization Information
    • Roles and Permissions
    • MyMoveworks SSO
  • Moveworks Setup
    • Accessing Moveworks Setup
    • First-Time Login via Magic Link
    • Moveworks Setup Modules
    • Moveworks Setup: Module How To Guides
    • Plugin Management
    • Monitor Alerts
    • Audit Logs
    • DSL Fields Defaults
    • Data Crawling View
    • API Playground
    • Setup Homepage
    • Troubleshooting Hub
    • Security and Privacy Settings
    • Configuration Delete
    • Advanced Config Editor
    • Identity configuration
    • Onboarding Stage
  • Security
    • Security
    • Hyperlink & Button Expiry
    • Attachment Handling
    • Moveworks Subprocessors
  • Provision Management
    • Overview
    • Access Software
    • Access Groups
    • Access Account
  • Access Requirements
    • Overview
    • Update Set Modules
    • Ticketing Systems & ITSMs Access
    • Identity and Access Management Systems Access
    • Multi-Factor Authentication (MFA) Systems Access
    • Knowledge Access Requirements
    • Email Distribution List Systems Access
    • Facilities Management Access
    • Live Agent Chat Access
    • HR Information System Access
    • Expense Management Access
    • Calendar Management Access
  • Core Platform
    • User Identity
    • Moveworks On-Prem Agent
    • Approvals Engine
    • Entity Catalog
    • Configuration Languages
      • DSL Builder and Evaluator
      • Moveworks Custom Attributes
      • DSL Reference
      • Data Mapper / JSON Bender Reference
        • Moveworks Data Mapper Common Examples
    • Moveworks Data Objects
    • SIEM
  • Employee Experience Insights
    • Overview
    • Breaking Down the Dashboard
    • Understanding Industry Benchmarks
    • Apps & Services
    • Impact Module
    • EXI Common Use Cases
    • Configure EXI
    • Ticket Backpolling
  • Knowledge Studio
    • Overview
    • Knowledge Studio Configuration
    • AI Powered Recommendations
    • Inspecting & Verifying Sources
    • Publishing Articles
    • Creating Knowledge Articles
    • Resolving IT Tickets Guidance
DeveloperAcademyCommunityStatus
On this page
  • Overview
  • Examples
  • Display a list of items in a single field
  • Context
  • Given Payload Response
  • Bender Mapping
  • Expected Result
  • Return unique elements from an array
  • Context
  • Given Payload Response
  • Bender Mapping
  • Expected Result
  • Remove empty keys from the output mapper in a return statement
  • Context
  • Given Payload Response
  • Bender Mapping
  • Expected Result
Core PlatformConfiguration LanguagesData Mapper / JSON Bender Reference

Moveworks Data Mapper Common Examples

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Moveworks Data Objects

Next
Built with

Overview

In Moveworks’ real-world scenarios, Bender examples are integral to streamlining processes within the Moveworks platform. These Bender examples are designed to help you write benders faster, showcase how obscure data can be molded into readable and friendly data, and improve your user experience and productivity.

Examples

Display a list of items in a single field

In many scenarios, especially within ticketing or request management systems, there’s a need to display aggregate information in a concise and readable format. One common requirement is to list entities such as approvers for a request or tasks associated with a ticket in a single, easily digestible field. This example demonstrates how to accomplish this by aggregating a list of approver names into a single field named approvers.

Context

Consider a situation where a system generates a payload response containing an array of approvers, each with their name, email, and an external identifier. The goal is to compile these names into a single string that lists all approver names, separated by commas, and display this list in a field called approvers.

Given Payload Response

1{
2 "approver_list": [
3 {
4 "name": "John Doe",
5 "email": "john.doe@example.com",
6 "external_id": "123456"
7 },
8 {
9 "name": "Jane Smith",
10 "email": "jane.smith@example.com",
11 "external_id": "7891011"
12 },
13 {
14 "name": "Alex Johnson",
15 "email": "alex.johnson@example.com",
16 "external_id": "121314"
17 }
18 ],
19 "etc...": {}
20}

Bender Mapping

JSON
YAML
1{
2 "approvers": {
3 "RENDER()": {
4 "template": "{{ users }}",
5 "args": {
6 "users": {
7 "EVAL()": {
8 "expression": "$CONCAT(users, ',')",
9 "args": {
10 "users": {
11 "MAP()": {
12 "items": "approver_list",
13 "converter": "item.name"
14 }
15 }
16 }
17 }
18 }
19 }
20 }
21 }
22}

Expected Result

1{
2 "approvers": "John Doe, Jane Smith, Alex Johnson"
3}

Return unique elements from an array

In many scenarios, especially within data processing or application development, there’s a need to ensure that duplicate data is not unnecessarily processed or displayed. A common requirement is to extract and return only the distinct elements from a dataset, such as an array. This example demonstrates how to achieve this by filtering out duplicate entries and returning a list of unique elements.

Context

Consider a situation where a system generates a payload response containing an array of elements, each of which might appear multiple times. The goal is to filter this array to return only the distinct elements, thereby eliminating any duplicates.

Given Payload Response

1{
2 "data": [1, 2, 4, 3, 1, 4, 5, 6]
3}

Bender Mapping

JSON
YAML
1{
2 "items": {
3 "EVAL()": {
4 "expression": "sorted_records.$FILTER((x, i) => i == 0 OR x != sorted_records[i - 1])",
5 "args": {
6 "sorted_records": {
7 "SORT()": {
8 "items": "data",
9 "key": "item"
10 }
11 }
12 }
13 }
14 }
15}

Expected Result

1{
2 "items": [1, 2, 3, 4, 5, 6]
3}

Remove empty keys from the output mapper in a return statement

In some cases when working in Agentic Automation your API response will not return certain fields or return them as null and you don’t want to provide it to the return statement at all so the LLM doesn’t pull any context from the fact it’s null.

Context

Imagine a scenario in which a SharePoint system returns PO information and you only want to map specific values from the response to return in your Agentic Automation Plugin. Sometimes certain fields will be null or non-existent.

Given Payload Response

1{
2 "data": {
3 "title": "PO1234",
4 "status": "Complete",
5 "email": null,
6 "country": "US"
7 }
8}

Bender Mapping

The mapping uses the EVAL operator to run the $FILTER() DSL against the final object to remove any null keys. Within this EVAL the args we are passing through to build the object which we will run the FILTER against.

1- return:
2 output_mapper:
3 EVAL():
4 expression: sharepoint_info.$FILTER(x => x)
5 args:
6 sharepoint_info:
7 sp_title: data.title
8 sp_status: data.status
9 sp_user: data.email

Expected Result

1{
2 "sharepoint_info": {
3 "sp_title": "PO1234",
4 "sp_status": "Complete"
5 }
6}