Create metafield definition
The Create metafield definition action creates a metafield definition based on the provided information.
On this page
Fields
The Create metafield definition action contains the following fields.
Field | Description |
---|---|
Name | Required. The name of the metafield definition. |
Description | The description for the metafield definition. |
Namespace | Required. The container for a group of metafields to associate the metafield definition with. |
Key | Required. The unique identifier for the metafield definition within its namespace. |
Resource type | Required. The resource type that the metafield definition is attached to. |
Data type | Required. The type of data that the metafield stores. |
Triggers
The Create metafield definition action can be used with all triggers.
Example

In this example workflow, a company metafield definition with the namespace custom and the key industry is created when a new company is created and such a metafield definition does not exist.
API details
To learn more, review the metafieldDefinitionCreate mutation.
Templates
Create and initialize shop metafields
Use shop metafields with Flow by creating definitions and initializing the metafield with the value(s) you need. View template
Send B2B order invoice to multiple email addresses
Send invoices for B2B orders to multiple email addresses. This will use the email addresses saved as Metafields in a company location, if they exist, or this will first create three Metafields: extra_invoice_recipient.email1, .email2, .email3. View template