Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
I have a feeling this may not be possible, but figured it may be worth asking anyway. I'm looking to add metafield data that's sourced from info that's already included in a product's description. I deal with disc golf discs and each disc has 4 numbers to represent how it flies, Speed, Glide, Turn, and Fade, which are notated as "X / X / X / X". My product descriptions include a line that reads "Flight numbers: X / X / X / X". I'd like to have each one of those numbers separated out to be attached to the product as a metafield so that customers can use them for filtering.
Is there a way to do something like use wildcards to isolate those numbers from the description and save them as the appropriate metafield?
The (very) long workaround alternative I'm imagining is changing my descriptions to read something like "Speed: 5, Glide: 4, Turn: -1, Fade: 1" and then a series of flows like "check if... description includes 'speed: 5' --then--> add/update product metafield 'custom.speed' with value 5", but that sounds like many many hours of work and may not be worthwhile compared to simply editing the metafields manually at that point haha.
Hi, this is probably possible using liquid. I might look at "split": https://shopify.github.io/liquid/filters/split/
For example:
{% assign split_description = product.description | split: "Speed: " %}
This would return everything before Speed and then "5, Glide: 4....". So you would need to take the second item in the list and split it again by the comma. And then repeat for each value you want. I think this would return the speed, as long as "Speed:" always exists in the text and there is only 1 of them.
{% assign speed = product.description | split: "Speed: " | last | split:"," | first %}
{{ speed }}
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024