โ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โฆ