Forum Discussion
Thanks @tarena.
The data is coming in from a REST Get. I then run it through a Script Snap in order to do some desired data matching and manipulation. I’m pretty sure I can’t use a Splitter first, due to the way the API returns what I need. So I’m essentially dealing with one document here. Sounds like maybe I need a splitter after the fact instead? I played around with that a tad, but perhaps it’s time to revisit this.
And yes, the data looks just like the attached file, although I removed some things for the sake of brevity and privacy.
You can use the following expression to split the Data object into a JSON List of objects. Even though Data is an object, its keys are a list. You can leverage that fact to create a new list using the Map expression. Each row will be the object at a key in the original object.
$data.keys().map(k => $data.get(k))
Now that you have a list, you can use the JSON Split snap to create your document stream and your CSV.
- alchemiz3 years agoContributor III
Hi guys, you can also use $data.values()