Auto populate meta field with text from a product name

Solved

Auto populate meta field with text from a product name

HOCuser
Tourist
4 0 1

Does anyone here know if it's possible to create a meta field that will auto-populate with a part of a product's name? We have thousands and thousands of items that we want to set up a custom sorting method for but it would take forever to edit each item to add in a custom metafield. I'm hoping we can create a meta field that will just pull the data it needs from part of the product's name. The part of the product name I want it to pull is within square brackets, like this "Product Name [Sub Name]".

Accepted Solution (1)

tim
Shopify Expert
3627 314 1341

This is an accepted solution.

Can do this with Flow app:

Screenshot 2024-06-15 at 12.26.17 AM.png

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 5 (5)

tim
Shopify Expert
3627 314 1341

This is an accepted solution.

Can do this with Flow app:

Screenshot 2024-06-15 at 12.26.17 AM.png

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
HOCuser
Tourist
4 0 1

Hey Tim,

 

Thanks for replying. This looks great and I tested it out and it works pretty well but I'm hoping they there is a way to get it to tigger that doesn't require the status of the product updating. We have thousands of products so I'm trying to avoid needing do any part of this manually. Any thoughts?

tim
Shopify Expert
3627 314 1341

Of course, the trigger in my flow is just an example. 

 

Can use "Product added to the store", but then also would need to loop over existing products and update those, in a separate flow.

 

Say, you can have a flow which will run once, or daily, loop over products, skip ones with the metafields and update the rest.

If you have many products, this needs to be done carefully to not hit the limits. 

Check https://help.shopify.com/en/manual/shopify-flow/advanced-workflows for further info.

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
HOCuser
Tourist
4 0 1

Thanks again for your help so far Tim. 

 

Do you know how I would get a Get Product Data pull to skip items that already have something in the metafield? 

 

HOCuser_0-1719342290641.png

 

This flow I made currently works but it just pulls the same 100 items over and over. I tried to make a query to look for the metafield value but it did not work.

tim
Shopify Expert
3627 314 1341

Yeah, you'd need an advanced query for this and I vaguely remember there was a problem with filtering by metafields, sorry not sure if it's still a problem, can't test right now.

However one workaround possible is to use tags for this purpose, say, select products without a tag, with query like tag_not:processed, process them and assign this tag...

 

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com