Accessing complex data objects in Shopify Flow

Shopify Flow doesn't support outputting arrays and objects. To control the data output and avoid new data when API fields are added, do the following instead:

  • Loop over arrays.
  • Include the required fields explicitly.

Complex data objects in the original Flow

In the original Flow, calling {{ order.lineItems }} in Liquid outputs the object in Ruby format. Calling with the | json filter outputs the object in json.

Complex data objects in Shopify Flow

Avoid calling arrays and objects directly in Shopify Flow for the following reasons:

  • Outputting data that isn't required is deprecated for GraphQL API, and it might create large query sizes that cause your workflow to fail.
  • When new features are introduced, new API fields are added, which might break your workflow.

If too much data is sent automatically, the workflow fails. Instead of calling arrays and objects directly, loop over arrays and include only the fields that you want.

For example, instead of calling {{ order.lineItems }} directly, use the following format to call specific fields. These examples include all the fields that would be included by calling the array or object directly. Copy and paste the fields that you need.

Ready to start selling with Shopify?

Try it free