I am wondering if there is any way to concatenate the values of JSON attributes into one new attribute using JOLT transformation.
For example, I have the following JSON:
{
"name": "Mary",
"Year Joined": "2017",
"Gender": "Female"
}
and I would like it to be transformed into this:
{
"new": "Mary_2017_Female"
}
Is it possible to do this using JOLT or are there other alternative ways to do it?
Yes, but it uses a "beta" transform that may change in the future.
http://jolt-demo.appspot.com/#modify-stringConcat
Expanding @Milo answer (not a fan of links outside SO)
Yes, you can achieve this using modify-overwrite-beta
transform
The specification for your example would look like:
[
{
"operation": "modify-overwrite-beta",
"spec": {
"new": "=concat(@(1,name),'_',@(1,Year Joined),'_',@(1,Gender))"
}
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With