Forum Discussion
mohit_jain - I had a similar request from another SnapLogic employee to flatten the incoming JSON document to remove the object nesting. This is actually a fairly complex request to solve within the SnapLogic expression language since multi-statement logic isn't allowed. However, I was able to solve it using an expression library, some simple recursion, along with some array and object methods and the jsonPath function. While the expression used to actually do the work is complex, the call to the expression library function is quite simple.
Download the attached ZIP file, decompress it, and upload the object.expr as an Expression Library reference in your pipeline:
Then setup your Mapper as follows to flatten your object as desired:
I would normally provide more detail about how this works, but the description of the flatten() method used here is much more complicated that I can briefly describe in a post.
Hope this helps!
Thank you so much koryknick
It really worked for me Thanks for looking into this.