How to auto-update the shopify product category field using flow

How to auto-update the shopify product category field using flow

SAnderson_GW
Tourist
5 0 2

I am trying to update the product category field using flow upon product creation when a product tag matches a certain value. 

 

I have found a searchable list of the shopify's standard product taxonomy (it's here for anyone interested: https://shopify.github.io/product-taxonomy/releases/unstable/?shpxid=a02a363e-0852-4075-31FD-D61DCE0...) so can identify the 'Category ID' value to be used. 

 

I assume shopify's product category field is a metafield and therefore the action required in Flow is to update product metafield. Is this correct and if so, how can I locate the namespace, key and type so I know what is required to be entered in the Flow action?

 

If what is required in the Value field for this query is more complicated than entering the correct 'Category ID' from the taxonomy list then please can you let me know the correct code/variable to enter. 

 

Is there a full list of namespace, key & type for each of shopify's metafields (the product category one specifically in this case) that I can reference for other queries like this that I have? 

 

 

Replies 4 (4)

RPiii
Shopify Staff
137 24 39

Hi @SAnderson_GW 👋 I don't think product categories are defined as metafields on the product but rather in the category field on the product. You can probably automate setting that value in Flow using a productUpdate mutation via the Send Admin API request action.

wonena-dev
Shopify Partner
26 0 8

I am using this type of mutation but the category field is not available.

Building a Sustainable Marketplace from Scratch
RPiii
Shopify Staff
137 24 39

Hmm, looks like productVariantUpdate might be a way to update product.category. Have you tried that?

Lawson_Thalmann
Shopify Partner
83 0 67

I also need to be able to do this and don't know how to write mutations. It feels strange that this is such a key Shopify feature that they've launched and they've also launched so many updates to Flow, but they don't have this very simple capability. Also, the AI that suggests the Product Category is not very good... lol