Update variant metafield based on variant inventory qty

I’m trying to set up a Flow to do the following but I can’t seem to get there:

  • Trigger from inventory quantity change
  • Check if:
    • Variant inventory qty > 0
      • AND
    • Variant metafield namespace = custom
      • AND
        - Same variant metafield key = instock
        - AND
        - Same variant metafield value = FALSE
        - OR
        - Same variant metafield does not exist
  • Update variant metafield value to TRUE, otherwise…
  • Check if:
    • Variant inventory qty < 1
      • AND
    • Variant metafield namespace = custom
      • AND
        - Same variant metafield key = instock
        - AND
        - Same variant metafield value = TRUE
        - OR
        - Same variant metafield does not exist
  • Update variant metafield value to FALSE

Anyone know if this kind of flow is possible?

If you are going to update the variant metafield regardless, I would remove logic about the metafield from a condition, and instead write it in liquid in the action’s value field.

Hi @paul_n - would you be able to provide an example of how that would work?