Få tilgang til kompliserte dataobjekter i Shopify Flow

Shopify Flow støtter ikke returnering av matriser og objekter. For å kontrollere utdataene og unngå nye data når API-felter legges til, gjør du i stedet følgende:

  • Loop over-matriser.
  • Inkluder de påkrevde feltene eksplisitt.

Kompliserte dataobjekter i opprinnelige Flow

I opprinnelige Flow vil Liquid-kallet {{ order.lineItems }} returnere objektet i Ruby-format. Et kall med | json returnerer objektet i 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.

Er du klar til å begynne å selge med Shopify?

Prøv det gratis