Automatically assign metaobjects

Is there a way to automatically assign metaobjects to products if they are in a certain collection or have a certain metafield?

I using metaobjects to showcase the brand for each product, but our store have a lot of products. Therefore it extremely tedious to assign every metaobject manually in the shopify backend.
Our products gets imported into the shopify backend with their brand name assigned to a metafield as “single line text”. And most products are also sorted into a collection based on their brand. However I would like to showcase a small logo of every brand using the meta objects.

Is it possible to do this in an automated way either either based on collection or the content of a metafield?

Hi @mns-burg
If the brand name is already assigned to a metafields, you can upload the logos of the brand to the files & fetch the URL of that logo, and assign the metafield name at the end.

For Ex.

- https://abc.myshopify.com/cdn/shop/files/{{ metafield for brand name}}.jpg

Make sure to name the logo image the same as the brand name.

Hi @mns-burg ,

Yes, you can create the brand listing metaobject at global level and map metaobject with product or collection based on tag.

Code will match the product tag with metaobject key if they matched image will be shown.