How to Change the Name of a Key

This article explains how to change the name of a key by using a key mapper transformer.

Goal: we want to change the key “qty” to “qtyOrdered”.

Initial data: 

{

 "row_total": 250,
"qty": 67

}

Create a new transformer: Connections -> transformers -> + for a new one

Settings: Data, transform data using mappers and conditions 

Transformer: key mapper (changes keys - name in the string identifying the value) Key accessor -> keys - qty

Mapper: standard -> string - qty -> string -> qtyOrdered 

Comparator -> adaptive equals comparison  (it will only check for the value and not for the data type)

Result:

{
"row_total": 250,
"qtyOrdered": 67
}