Basics

[items array: {json:obj}, {json:obj}, {json:obj}]

[items array: [ json array: {obj}, {obj}, {obj} ] ]

Unbundling

When you have the second type of data structure, you need to:

  1. First unbundle the json array into items

  2. Then run operations on each individual item.

To do this, use a function node:

return items[0].json.map( item => ( { json : item } ));

Nested Items

Sometimes (e.g. with external APIs returning data in a different format), you will encounter nested items. This usually means the data we are interested in is its own object nested within the JSON response from the API.

Where "results" is the object/array of interest, we would modify our function above as so:

return items[0].json.results.map(item => ( { json : item } ));

Recap