Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hello,
I am trying to write a Flow which triggers on a Product variant inventory quantity being changed, the trigger works. The check if I am using is if options_item.position = 1 and options_item.name = color, that also works and tells me that color is is in the first position. Once I get it to work I would create two more check ifs for position 2 and 3, maybe there is a way to do all in one but I am a novice.
My issue is the Action step, specifically the code I need to grab the option name from position 1, or the position where options_item.name = color.
The above returns the following error for the product I am testing. Exception: Got error updating metafield: "Value must be a single line text string." For value: "\n Orange\n\n 28mm\n\n\n", Type: single_line_text_field
This leads me to believe I either need an if statement to only return the option value in position 1 or there some sort of other reference I am missing. Any help would be very appreciated! I intend to the same with the Google: Size Metafield.
Steve
Hi Steve 👋 For the metafield "mm-google-shopping.color", the namespace is the string before the period and the key is the string after. In your step configuration, the namespace should be "mm-google-shopping" and the key should be "color".
Thank you, I will make that change. But I don't think that fully solves my problem because I want it to only return the value of the Option with name matching color, in this case that is position 1. Can you help with the code needed?
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025