Parse ndjson / Streaming API Data with make.com

A. Parse JSON with functions + (optional) map Method

Yes, that is possible. You’ll need just one module (one operation):

Screenshot_2024-08-30_090831

A second optional module can be used to map out the inner collection.

Screenshot_2024-08-30_090842

Example Output

Screenshot_2024-08-30_090851

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":14,"module":"util:ComposeTransformer","version":1,"parameters":{},"mapper":{"value":"{\"result\":{\"question_id\":\"9192e9f4-69c8-445c-b3b9-337a1d560916\",\"modified_at\":null,\"question_answer\":{\"responses\":[],\"note\":\"\",\"media\":[],\"attachments\":null},\"location\":null}}\n{\"result\":{\"question_id\":\"f3245d42-ea77-11e1-aff1-0800200c9a66\",\"modified_at\":\"2022-07-06T19:35:59Z\",\"datetime_answer\":{\"answer\":\"2022-07-05T22:00:00Z\",\"attachments\":null},\"location\":null}}\n{\"result\":{\"question_id\":\"f3245d43-ea77-11e1-aff1-0800200c9a66\",\"modified_at\":\"2022-07-06T19:32:36Z\",\"text_answer\":{\"answer\":\"Manfred Mustermann\",\"attachments\":null},\"location\":null}}"},"metadata":{"designer":{"x":-48,"y":-342,"name":"Sample NDJSON"}}},{"id":15,"module":"json:ParseJSON","version":1,"parameters":{"type":""},"mapper":{"json":"{\"items\":[\n{{join(split(14.value; newline); \",\")}}\n]}"},"metadata":{"designer":{"x":197,"y":-342},"parameters":[{"name":"type","type":"udt","label":"Data structure"}]}},{"id":16,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"items","scope":"roundtrip","value":"{{map(15.items; \"result\")}}"},"metadata":{"designer":{"x":440,"y":-343,"name":"Map inner collection"}}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!