Global Action: Set a metafield value for any resource
The Set a Metafield Value for Any Resource Action allows you to write or update metafields on any Shopify resource supported by the Shopify API. This includes resources such as Orders, Products, Customers, Variants, Collections, Shop, and more. Because this is a Global Action, it can be used in any Workflow regardless of the trigger type.
Configuring the Action
| Field Name | Description | Example |
|---|---|---|
| Resource Type | The type of Shopify resource you want to update (e.g., Order, Product, Customer). | Order |
| Resource ID | The unique ID of the resource. Often supplied from workflow Tokens. | {{ order.id }} |
| Namespace | Namespacing helps group related metafields. | custom |
| Key | The specific metafield key you want to set or update. | warehouse_status |
| Metafield Type | The data type of the metafield. Shopify supports types such as single_line_text_field, number_integer, boolean, and others. |
single_line_text_field |
| Value | The value to assign to the metafield. Must match the selected type. | ready_for_pickup |
Troubleshooting & Usage Tips
“Invalid metafield type” error: Ensure the metafield type matches the value you are providing. For example, a boolean metafield must be set to true or false, not a string.
Resource not found: Verify that the Resource ID is correct and that the Workflow has access to the corresponding Token (e.g., {{ order.id }}, {{ product.id }}).
Metafield not appearing in Shopify: Some resource types require metafields to be added to a Shopify Metafield Definition before they appear in the admin interface. The value will still save, but the field may not be visible until a definition is created.
Overwriting existing metafields: If a metafield with the same namespace and key already exists, this Action will update it. If you require conditional updates, add Workflow Conditions before this Action runs.
Credit Cost
The Set a Metafield Value for Any Resource Action incurs a cost of one Action Credit on Lite plans and is unlimited on Unlimited plans.
Custom Actions
The Set a Metafield Value for Any Resource Action is fully supported in Custom Actions. Further information and examples can be found in the documentation.