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