Shopify Flow - Access typed metafields

Published

This summary was written by ShopDigest AI from Shopify Changelog’s report. Read the full story ↗

You can now check metafield values more easily in the Flow app. Each resource (product, orders, etc) has a new metafield field. When you choose met…

Overview

Shopify Flow now supports typed metafields, allowing users to select known metafields for resources like products and orders. This simplifies checking metafield values and enables use of metafield types, such as product references, in Flow steps and Liquid. The old method of looping over metafields will be deprecated.

Key Details

  • New metafield field on each resource in Flow lets you pick from known metafields.
  • Selecting a metafield generates an alias for use in subsequent steps and Liquid.
  • Typed metafields allow access to referenced data, e.g., product.recipe.value.title.
  • Old loop-based metafield access is deprecated due to performance issues.

Frequently asked questions

What is new about metafields in Shopify Flow?

Shopify Flow now provides a dedicated metafield field for each resource, letting you select from known metafields instead of manually looping through the metafields list. Selecting a metafield generates an alias that Flow uses to fetch the data, which you can then reference in subsequent steps and Liquid.

How do typed metafields work in Shopify Flow?

Typed metafields preserve their data type in Flow. For example, a product reference metafield named 'recipe' lets you access the referenced product's title directly using {{ product.recipe.value.title }}. This is more efficient than the old method, which treated all metafield values as strings.

Why is the old way of accessing metafields in Flow being deprecated?

The old method required looping over the metafields list on resources, which treated all values as strings and could cause performance issues when there were many metafields or when values were very large. The new typed metafield access is faster and more reliable, so Shopify is deprecating the old approach.

About this story

Published
25 Apr 2024
Originally published at