Copy Product Category to Metafield

Topic summary

Goal: Populate a product metafield (Category, single line text) with the product’s taxonomy node name (e.g., “Pants”, “T-Shirts”) using Shopify Flow.

Issue: The Flow attempted to write a multi-line value containing many taxonomy terms, causing the error: “Value must be a single line text string.” This indicated the wrong source field was selected, returning a list rather than a single category name.

Resolution: The correct product category field needed for a single node name was found under the “Deprecated” section. Selecting the proper “category” field resolved the mismatch. Note: The user observed guidance to use an option called “category,” though it initially didn’t appear in the list.

Status: Resolved. No further action items noted.

Key terms:

  • Metafield (single line text): A custom product field that accepts only one line of text.
  • Taxonomy node name: The specific category label assigned to the product.
  • Shopify Flow: Automation tool used to read a product field and update a metafield.
Summarized with AI on December 24. AI used: gpt-5.

I’m trying to update a metafield called Category (single line text) with the item taxonomy node name (“Pants”, “T-Shirts”, etc.) I thought the flow in the screenshot below would do this but I get the following error:

Got error updating metafield: “Value must be a single line text string.” For value: “\n Activewear Pants\n\n Athletic Shoes\n\n Backpacks\n\n Baseball Caps\n\n Beach Towels\n\n Blouses\n\n Bodysuits\n\n Boots\n\n Bras\n\n Bucket Bags\n\n Cardigans\n\n Cargo Pants\n\n Classic Bikinis\n\n Clothing Tops\n\n Clutch Bags\n\n Coats & Jackets\n\n Coin Purses\n\n Cosmetic & Toiletry Bags\n\n Cover Ups\n\n Cowboy Hats\n\n Cross Body Bags\n\n Denim Shorts\n\n Dresses\n\n Duffel Bags\n\n Fanny Packs\n\n Fedoras\n\n Flats\n\n Handbags\n\n Hats\n\n Heels\n\n Hoodies\n\n Jeans\n\n Joggers\n\n Joggers\n\n Kimonos\n\n Leggings\n\n Leggings\n\n Loungewear\n\n Nightgowns\n\n One-Piece Swimsuits\n\n One-Pieces\n\n Outfit Sets\n\n Pajamas\n\n Pants\n\n Polos\n\n Robes\n\n Sandals\n\n Satchel Bags\n\n Shirts\n\n Shoes\n\n Shorts\n\n Shorts\n\n Shoulder Bags\n\n Skirts\n\n Skorts\n\n Slippers\n\n Sneakers\n\n Sun Hats\n\n Sweaters\n\n Sweatpants\n\n Sweatshirts\n\n Swimwear\n\n T-Shirts\n\n Tank Tops\n\n Tote Bags\n\n Tunics\n\n Wallets\n”, Type: single_line_text_field

Appreciate an insights re: how to make this work . Thanks.

Forget it. I was selecting the wrong field value for product category. The one I needed was under “Deprecated” and it said to use an option called “category”, but that wasn’t on the list.

1 Like