cancel
Showing results for 
Search instead for 
Did you mean: 

Transforming JSON Data

skodali
New Contributor III

Hello All,

Trying to transform the JSON data into a mapper. Can anyone help me to get this resolved without using the script snap? Attached the pipeline with JSON generator and expected output.

JSON Mapper_2020_02_12.slp (10.3 KB)

image

Thanks!

1 ACCEPTED SOLUTION

cjhoward18
Employee
Employee

Try taking a look at the sl.zipObject() function:

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439396/SL+Functions+and+Properties#SLFunc...

Using your $Columns as keys and your $data as the values from your example pipeline like this:
sl.zipObject($Columns, $data) should give you close to what your looking for.

View solution in original post

1 REPLY 1

cjhoward18
Employee
Employee

Try taking a look at the sl.zipObject() function:

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439396/SL+Functions+and+Properties#SLFunc...

Using your $Columns as keys and your $data as the values from your example pipeline like this:
sl.zipObject($Columns, $data) should give you close to what your looking for.