Add Custom Metafield Value to automated internal email when order is placed

Topic summary

A user is building a Shopify Flow automation to send internal emails when orders with specific tags are placed. The email template is mostly complete but they’re struggling to pull in two customer metafield values:

Missing metafield data:

  • Workday ID (customer_fields.workday_id) - customer’s accounting system identifier
  • Customer Email For Invoice Delivery (custom.customer_email_for_invoice_delivery) - email addresses for invoice recipients

These values need to be included in the automated email since invoices are sent through external accounting software rather than Shopify.

Solution provided:
A respondent explained that metafields cannot be referenced directly in Flow’s Liquid syntax. Instead, Flow requires looping through the metafields list. They provided a concise Liquid code snippet that:

  • Assigns the metafield to a variable by filtering on namespace and key
  • Extracts the value using first
  • Outputs the result

The discussion appears resolved with a working technical solution, though implementation confirmation is pending.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

Hi Everyone,

I am creating an internal email that goes out utilizing Flow. It is triggered when we recieve a new order that has a specific tag. I have everything working but there are some customer custom field values that we would like to add to the email. All of our invoices are sent out through our companys accounting software outside of shopify. In this system our customers have an id number so we would like to add that to the email that is sent. Currently, we are using a customer metafield to house this id number.

Name: Workday ID

Namespace and key: customer_fields.workday_id

We also need to add any/all of the customer’s email addresses that need to recieve the invoice. We created a metafield that we can input these emails.

Name: Customer Email For Invoice Delivery

Namespace and key: custom.customer_email_for_invoice_delivery

Below is an example of the email that is being created. The two in red are the two that I can not figure out how to pull in:####

Please Review the following Purchase Order for Release:
https://premier-marketplace-dev.myshopify.com/admin/orders/{{order.legacyResourceId}}

Order Number: {{order.name}}

Order Creation Date:

Terms: Net 30

Fulfillment Status: {{order.displayFulfillmentStatus}}

Workday ID: {{order.customer.customer_fields.workday_id}}

Customer Name:{{order.customer.displayName}}

Customer Email: {{order.customer.email}}

Customer Email For Invoice Delivery: {{order.customer.customer_email_for_invoice_delivery}}

Company: {{order.billingAddress.company}}

Billing Address: {{order.billingAddress.address1}} {{order.billingAddress.address2}} {{order.billingAddress.city}}, {{order.billingAddress.province}} {{order.billingAddress.zip}}



Subtotal:



{{order.subtotalPriceSet.shopMoney.amount}}



Shipping:



{{order.totalShippingPriceSet.shopMoney.amount}}



Tax:



{{order.currentTotalTaxSet.shopMoney.amount}}



Total:



{{order.currentTotalPriceSet.shopMoney.amount}}

You cannot use metafields like that in Flow liquid. Flow instead loops over the list of metafields. The most concise way to get a specific value is this:

{%- assign my_mf = order.customer.metafields | where: "namespace","customer_fields" | 
 where: "key","workday_id" | first -%}
{{- my_mf.value -}}