That all looks right. Why are you still using “Get variant data”? You could be updating a different variant that one on the product. And are you sure that the variable isn’t actually set? It likely is, but you are looking at the wrong variant (not necessarily the one that comes first in the UI)
Topic summary
Goal: auto-populate a variant metafield with the product’s price when a product is created in Shopify Flow.
-
Initial approach used “Get product variant data” with a GraphQL query, which returned no results. That action expects Shopify search syntax (e.g., id filter using legacyResourceId), not GraphQL.
-
Guidance: you can access variants directly via product.variants without an extra query. Use Log output to debug values before updating metafields.
-
Blocker: the “Update product variant metafield” action lacked a Money type. The team added Money to the type dropdown, enabling proper updates.
-
Formatting: Flow’s Liquid doesn’t include money filters; the Money metafield expects a single JSON object with amount and currency_code. Output only one variant’s value (e.g., first/default) and ensure the correct namespace/key.
-
Important nuance: the “Get product variant data” action may not return default variants for single-variant products. Removing that action and iterating product.variants avoids mismatches.
Outcome: switching the For each loop to product.variants and using the new Money type successfully updates the variant metafield. Issue resolved; no open questions.