Metafields in Flow

When building a workflow you might want to get or set metafield and metaobject data in your store.

Get metafield data

Metafield data is different than other store data because each field is custom to your shop, and it can be a different type than other data in your store. Because of this, Flow needs to do extra work in order to provide you with an easy way to access this data, which results in a different experience for you over just selecting a field in the environment such product.title.

To access metafield data on any resource, the process is roughly the same:

  1. Click Add a variable in an action, or Add criteria in a condition.
  2. Go to the resource where the metafield is stored (such as product, customer, order).
  3. Choose metafield from the list of fields. (note: don't choose metafields as this provides a list of all metafields).
  4. In the popup, select the metafield using the namespace and key, make a note of the alias name provided, and click Add.
  5. When the alias is added, the environment panel with reload and select the new metafield alias. From that new field, choose the variable you want to use. In some cases, this will simply be value. After adding a metafield to a workflow, you no longer need to add it again. You can simply reference it in subsequent steps.

Update metafield values

Flow provides actions to update metafield values:

Create metafield definitions

Flow also provides a way to create metafield definitions in your store. This is useful if you want to add metafields to resources that don't already have them.

Ready to start selling with Shopify?Try it free