在 Shopify Flow 中访问复杂的数据对象

Shopify Flow 不支持输出数组和对象。若要控制数据输出并避免在添加 API 字段时出现新数据,请改为执行以下操作:

  • 循环遍历数组。
  • 显式包含所需字段。

原始 Flow 中的复杂数据对象

在原始 Flow 中,在 Liquid 中调用 {{ order.lineItems }} 会以 Ruby 格式输出对象。使用 | json 筛选条件进行调用会以 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.

准备好开始使用 Shopify 进行销售了吗?

免费试用