Variant Metafield update last on flow wins

Topic summary

Variant metafields in Shopify Flow are being overwritten so all variants end up with the last size’s chart (e.g., XXL), instead of each variant (S, M, L…) getting its own size-specific HTML table.

  • Root cause: The condition checks loop over product options twice independently—once for any option named “Size” and separately for any option with value “S.” This doesn’t ensure both checks apply to the same option item, so the action triggers more broadly and later runs overwrite earlier ones.

  • Key terms: Variant = a specific product option combination; Metafield = a custom field on a resource; Shopify Flow = automation tool; Option/option_item = product option entries (e.g., Size).

  • Recommended fix: Use a single workflow. In the condition, click “Add criteria for same item,” select “option_item,” and require Name = “Size” AND Values = “S.” Delete the separate second condition. Verify in run logs that the action only fires for the matching variant.

  • Assets: Screenshots are central, showing the incorrect dual-condition setup and the corrected “same item” configuration.

  • Status: Detailed step-by-step guidance and a screenshot provided; confirmation of resolution pending.

Summarized with AI on December 29. AI used: gpt-5.

I am stumped by this scenario i have a workflow that when a variant is added it checks to see if the variant has a size option if so then checks to see if the size is S, M, L etc if it find the for example i want it to write a custom html table with dimension for that size in the metafield of the variant. What i am seeeing is the flow runs but the last one that is run is the one that wins and populates all the variant metafield, and what i mean by that is if there are S, M, L
then all the flows run but in the end result all the variant metafields with have the size information for the L variant.

lost ass to why this happens in my head the flow seems logical ass i would program in C#, can anyone enligthen me on why its doing this. I originaly had all in one flow So if S then if M then and it did this then i changed it to run as separate flows and it does same

Thanks

What is in that condition? I would not run this via separate workflows. More likely, this workflow is running for all variants and not just the “S” variant. Did you look at a workflow run to see if it’s calling the action even if it’s not a “S”?

It Checks to see the size if S then should write the small size chart etc
But it doesn’t do this it seems last one is wins situation

I need to see a screenshot of your condition as it’s likely configured incorrectly.

The condistion just checks to see if each item is a particular size if it is then on then element the code html should be written to the metafield for that variant. Whaat is not making sense to me is if it find an S then it should write the small size chart and if M then medium size chart, but it doesnt do that it write the same size chart to that of the last one find so if the largest size is XXL then XXL chart is even written the S size. As a programmer in C# this doesnt make sense to me at all very confused.

You are looping over product / options twice. So this is independently checking if any option name is Size. And if any option value is S. You want to check if a single option has a name of Size and a value of S.

If you click that first “add criteria for same list item” link, you can add a check for the value for the same option. Make sure to select “option_item” when you choose the variable there. Then delete that second criteria.

Hi Paul,

Thanks for assisting with this but i am totally lost as to what you are saying i need to do, i know a lot to ask but can you do a screeny of what my check if conditions should look like.

Thanks

Delete the second condition

Click Add criteria for same item

Choose “option_item” (not option), AND, and then values

Add the check for S

![16-33-ip929-rw7fw.png|777x992](upload://4p20HTj6eQygDyUY9h7R98nD8wI.png)