02-02-2021 07:15 AM
Hi ,
I have an array and I want to change the key/column names of it.
{
“Items”:{
“Item”:[
{
“Item”:'“Pen”,
“Desc”:“Black”
},
{
“Item”:"Pen ",
“Desc”:“Blue”
}
]
}
i want to rename the Item as WM_Item and Desc as WM_Desc
02-02-2021 08:00 AM
Hi @sjakathi
Please check the attached sample pipeline:
SL_Community_2021_02_02.slp (3.6 KB)
Hope this will help.
Regards,
Spiro Taleski
02-02-2021 08:09 AM
This expression in a Mapper snap:
$Items.Item.map(value => value.mapKeys((value, key) => "WM_" + key))
will add the ‘WM_’ prefix to the keys for each item in this Item list.
Having it mapped to the target Items.Item
will replace the old value with your desired output.
02-02-2021 11:21 PM
Thanks you all for the reply it worked…