Artisan SVG > JSON Transformer (json-transformer) (navigation-right-2)

Force an Array Object Structure

Snippet
Universal
Intermediate

Snippets are pieces of workflows. You can copy and paste them directly into any Tray workflow.

New to snippets? Watch this video

For more details please see our Snippet Documentation

About this Snippet
Copy

Make sure data is passed downstream as an array (even if it is one item).

Useful when you have an API that passes multiple items in an array, but single items as just an object. This makes it hard to handle that data downstream because you have to build logic for either option - unless you make the data consistent (as an array)

See it in action
Copy