Acceder a objetos de datos complejos en Shopify Flow

Shopify Flow no admite la generación de matrices y objetos. Para controlar la generación de datos y evitar datos nuevos cuando se agregan campos API, sigue estos pasos:

  • Bucle sobre matrices.
  • Incluye los campos obligatorios explícitamente.

Objetos de datos complejos en el Flow original

En el Flow original, al llamar {{ order.lineItems }} en Liquid se genera el objeto en formato Ruby. Al llamar con el filtro | json se genera el objeto en 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.

¿Estás listo/a para comenzar a vender con Shopify?

Prueba gratis