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"
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