Collection Action: Set a collection metafield value

The Set a Collection Metafield Value Action allows your Workflow to create or update metafields on a specific Shopify collection. This is useful for customizing collection-level content such as badges, filters, theme settings, SEO fields, or any structured data your storefront or apps rely on.

Configuring the Action

Field Name Description Example
Namespace A required grouping used to organize metafields. Namespaces help avoid conflicts between apps or features. custom
Key The unique identifier of this metafield within the namespace. Keys must be lowercase and contain no spaces. collection_badge
Type The Shopify metafield type that defines the acceptable data format (e.g., single_line_text_field, boolean, number_integer, json). single_line_text_field
Value The content that will be saved into the metafield. Can be a static value or a dynamic Token. {{ collection.title }}

You can also select one of the already defined collection metafields by checking the "Metafield Definition" checkbox.

Troubleshooting & Usage Tips

Metafield Not Appearing Inside Shopify: Ensured that the metafield is defined in Shopify first.

“Type Mismatch” Error: This happens when a metafield already exists but with a different type than what the Workflow is trying to write. Update the metafield definition in Shopify or adjust the value you are sending.

Token Format Issues: Make sure any Token used resolves to a format compatible with the metafield type. For example, JSON metafields must contain valid JSON.

Credit Cost

The Set a Collection Metafield Value Action incurs a cost of one Action Credit on Lite plans and is unlimited on Unlimited plans.

Custom Actions

The Set a Collection Metafield Value Action within Custom Actions is fully supported. Additional information and examples are available in the documentation.