With both suggestions, I get an error saying JSON format is not valid. I am assuming because the original file is in JSONL format it’s not recognizing it?
Hi @samliew, sorry for the delay in getting back to you. I’m not entirely sure how to implement your suggestion. Any chance you can give me some pointers to how I can split it into new lines and then use iterator?
I’m still trying to sort this out as well did anyone figure it out? I’m able to use a pattern match (?<=\n|^){.+?}(?=\n|$) and then a parse JSON to get the collections formatted, but it will have to run for each collection which would be a lot considering i’m using the bulk operation api from shopify. Ideally we wouldn’t run parse json for hundreds if not 1,000 results to format the collections correctly
toString() will transform the binary data into text, using split() on ‘newline’ splits the JSONL into individual JSON in an array, and the iterate module will split out each JSON into a bundle.
The Text Aggregator function is used to combine the JSON bundles back into a single JSON, it’s important to use the , separator to ensure valid JSON is the result.
Last, use the Parse JSON module to parse our now valid JSON into usable bundles of code (or leave unparsed depending on your needs of course). Note that I added around the JSON to make it valid.
Nice I think this actually works better. I figured it out w/ chat GPTs help, basically ran an a couple text parsers so that the parse json would recognize the data, but its not very pretty haha