Advanced Data Transformation: Element Mapper’s New JavaScript Editor

By David Honan in GET/technical Posted Oct 1, 2015

We are excited to announce a recent update to our data mapping and transformation tool, Element Mapper. Element Mapper now includes a JavaScript Editor for creating custom transformations.

At Cloud Elements, we believe in building everything “API-first”. Everything on the Cloud Elements platform is fully accessible using APIs. Our tool Element Mapper is just a UI on top of our fully functional Transformation APIs. As a developer using the Cloud Elements platform, you always have a choice. You have the choice to either use the APIs only,  switch between the APIs and the UIs we offer, or use the UI solely. But at the end of the day, everything is built fully on RESTful APIs. You can find documentation for our Transformation APIs here.

Data Transformations with Element Mapper

In most use cases, it is only necessary to map and transform the the field or object names. But for more complicated use cases, our JavaScript Editor enables developers to transform the data payloads instead of just the field name mapping. Before, Element Mapper gave you the ability to change the object name and field names, and now with this addition you can change the actual values of the fields.Data Transformation and Mapping Tool

Here are a few example of how you can use the Element Mapper JavaScript Editor.

Example 1: Combine ‘First Name’ and ‘Last Name’ Fields.

When mapping fields between two services, it is common to find that one service has separate fields for ‘First Name’ and ‘Last Name’, while the other service has a field called “Name” with first name and last name together. This causes an issue when you go to map these fields. The best way to map these fields without losing data is to transform the data payload to combine first name and last name into one field, before syncing the data with the connected service.

Using the JavaScript Editor, we simply wrote a short script to transform the payload, right in in the Element Mapper UI. Here is the JavaScript we used to perform the transformation:

Data mapping- Example 1

Example 2: Help Desk Ticket Syncing

Here is a more complex use case that is possible with the JavaScript Editor.

Let’s say I want my support tickets in to sync with my tickets in Zendesk. In, the field ‘Priority’ of a ticket is a rating 1 through 10. But in Zendesk, the ‘Priority’ field options are Low, Normal, High or Urgent. How do you map 10 field options in to the four field options on the Zendesk side? You need to customize the data payloads so that the data can be synced between the systems. We were able to write some simple JavaScript to do just that.

Data mapping for help desk ticket syncing

By changing the data payload, I am able to sync tickets across systems without sending data that isn’t applicable in the receiving system.

We hope that the addition of the JavaScript Editor to Element Mapper expands its potential use cases and value. Find the documentation for the JavaScript Editor here.

You can sign up for a free trial and try Element Mapper today. 

Try Element Mapper