โ05-30-2023 10:28 AM
I have to transform documents that look like the following:
[{
โIdโ: 999,
โfield1โ: โvalue1โ,
โfield2โ: โvalue2โ,
โfield3โ: โvalue3โ
}
]
Into output like this.
[{
โIdโ: 999,
โentityโ: {
โpathโ: โfield1โ,
โopโ: โreplaceโ,
โvalueโ: โvalue1โ
}
},
{
โIdโ: 999,
โentityโ: {
โpathโ: โfield2โ,
โopโ: โreplaceโ,
โvalueโ: โvalue2โ
}
},
{
โIdโ: 999,
โentityโ: {
โpathโ: โfield3โ,
โopโ: โreplaceโ,
โvalueโ: โvalue3โ
}
}
]
There can be multiple documents being processed and the number of โfieldsโ is more (30+) than the example shows. I have created a Mapper snap to do this work for a few fields but would like not to have to do it for 30+. I feel there is an expression/javascript solution to this but I am not well versed at this time.
Any ideas would be appreciated.
Regards,
Solved! Go to Solution.
โ05-30-2023 11:06 PM
Hi @Thom ,
Iโve attached a pipeline, hope this helps.
Test_Expression_2023_05_31.slp (3.5 KB)
Cheers ๐
โ05-30-2023 11:06 PM
Hi @Thom ,
Iโve attached a pipeline, hope this helps.
Test_Expression_2023_05_31.slp (3.5 KB)
Cheers ๐
โ06-01-2023 06:08 AM
Thanks so much. This worked as needed.
โ01-10-2024 04:19 AM
I'm unable to download the .slp file
โ01-10-2024 08:52 AM - edited โ01-10-2024 09:28 AM
The new community platform didn't quite know how to deal with the .slp file extension. Pipelines need to be zipped before uploaded to this community platform.
Let me find it in the backup.