cancel
Showing results for 
Search instead for 
Did you mean: 

Map Json Structure

Igor_Bozhinovsk
New Contributor III

Currently we have json data like this :
{
“Test”: “1”
“SerialNumbers”: {
“SerialNo”: [
“123”,
“456”
]
}

The desired output is like this:
{
“Test”: “1”
“SerialNumbers”: [
{“SerialNo”: “123”},
{“SerialNo”: “456”}
]
}

Is there any function we could use to achive this in SnapLogic ?

1 ACCEPTED SOLUTION

bojanvelevski
Valued Contributor

Hi there @Igor_Bozhinovski ,

I believe the following expression will give you the desired output:

$SerialNumbers.SerialNo.map(x=>{"SerialNo":x})

image

View solution in original post

1 REPLY 1

bojanvelevski
Valued Contributor

Hi there @Igor_Bozhinovski ,

I believe the following expression will give you the desired output:

$SerialNumbers.SerialNo.map(x=>{"SerialNo":x})

image