Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hey all, Now bear with me i will try to be as clear as I can.
I currently allow the user to filter my collection pages based on the sizes of the products
(Example: 56mm, 57mm, 60mm etc....)
On each of the product pages i tag the products like "Size_56mm" and thats how that works.
Now, to display the product details to the customer im using Metafields, (one for size, one for weight, one for material/colour etc...). To avoid me duplicating information (putting the size "56mm<sup>3</sup>" in the metafield AND the tags) I would like to make FLOW so that when the product inventory changes it checks to see if the product.metafields.custom.size contains a value and if it does it would add a tag to that product (I can do that and its easy enough) but the hard bit is getting the value from the metafield and manipulating it into something that can be filtered.
I need to turn the metafield value of "56mm<sup>3</sup>" into "Size_56mm"
Hope all of this makes sense.
So first, I would avoid doing this on inventory change. That is VERY frequent and not necessary as this kind of info shouldn't change that often.
As to the question, there are a lot of ways to do this in liquid. Maybe the easiest way, assuming you have a product metafield and just need "56mm" part is to split by <sup> and take the first value of the list
{% assign mf = product.metafields | where: "namespace", "foo" | where: "key", "bar" | first %}
{% assign new_mf = mf.value | split: "<sup>" | first %}
{{ new_mf }}
You can then use the list to output your string.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025