Showing results for 
Search instead for 
Did you mean: 

Some json strings questions

New Contributor III

We are just starting off with SnapLogic and we wonder if somebody can give us some answers to the following questions.

We have the following input




I have the following questions

  1. How do we remove the “original” object from the lines with expression language?
  2. How can we remove key "transactionId"and value from the lines with expression language?
  3. Once the original object is removed how can we convert the lines into an array with name “orderLines” with expression language?

Thanks for your help


Contributor III

Hello @Richard,

All your requirements can be done with the “Mapper” snap.

To remove any field from the JSON input, you can simply check the “Pass through” option in the Mapper, then in the “Expression” field, write the field from the input that you want removed, but leave the “Target path” empty. This will remove the field from the input object.


To remove the field “transactionId” you can do the same as above.


I’m not sure which lines you want to convert here into an array, can you elaborate on this ?

New Contributor III

Thanks for you answers, really appreciate it.

The above lines will have to put in an array if possible.

Further I did try to do your way of removing the original but in my case it worked once but the strange thing is that further on in the pipeline when I tried to do the same thing again it gives me an error that it cannot find the original, even though I can see it in he input schema. Have you seen that before?


@Richard ,

If you want to put each object into an array then write the following expression:

sl.ensureArray($.filter((val, key) => key != "original" && key != "transactionId"))

This expression will remove the original and transactionId fields from the input and put all fields into an array.

You can check all sl functions here: SL Functions.

If you want to put all objects into a single array then uste the Group by N snap, but change the expression in the Mapper to $.filter((val, key) => key != "original" && key != "transactionId")


I don’t know about this issue, if there is original in the input schema it should remove it without any problem, try validating the pipeline first and see if there is original object in the output data.

New Contributor II

Hi all,
I’m relatively new to JSON. For the example data that Richard provides can someone tell me what the proper syntax is to use in the JSON Generator snap? From the JSON Generator snap I’ve tried to Import the json data and I’m getting errors. One of the errors I’m seeing is 'Verify that the table values and the template are correct".