Hi @Bonusfeatures75 , you can probably do this with Shopify Flow. I created this Flow but haven’t tested it yet. Please install the Shopify Flow app. Open the app and click on Import and import the attached .flow file.
Then test with a product. Hopefully this will work. If not, please let me know.
Actually, Shopify won’t let me upload the flow file; so here’s what you need to do;
-
open any code editor or text editor
-
paste the following code in it
-
save the file, name it something like update-product.flow
-
then import it to Shopify Flow
3b72422d2cc12789299b4ef183fa92df029d058361196983a5d81be5d7844c78:{"__metadata":{"version":0.1},"root":{"steps":[{"step_id":"3feaebe0-14b2-11f0-b87c-255a5e178b59","step_position":[0,0],"config_field_values":[],"task_id":"shopify::admin::product_added","task_version":"0.1","task_type":"TRIGGER","description":null,"note":null,"name":null},{"step_id":"ab1e28a0-14b2-11f0-b87c-255a5e178b59","step_position":[360,0],"config_field_values":[{"config_field_id":"condition","value":"{\"uuid\":\"b9f830f7-14b2-11f0-b87c-255a5e178b59\",\"lhs\":{\"uuid\":\"b9f830f0-14b2-11f0-b87c-255a5e178b59\",\"parent_uuid\":\"b9f830f7-14b2-11f0-b87c-255a5e178b59\",\"array_path\":{\"uuid\":\"b9f830f1-14b2-11f0-b87c-255a5e178b59\",\"parent_uuid\":\"b9f830f0-14b2-11f0-b87c-255a5e178b59\",\"value\":\"product.tags\",\"comparison_value_type\":\"EnvironmentValue\"},\"array_item_key\":{\"uuid\":\"b9f830f2-14b2-11f0-b87c-255a5e178b59\",\"parent_uuid\":\"b9f830f0-14b2-11f0-b87c-255a5e178b59\",\"value\":\"tags_item\",\"comparison_value_type\":\"EnvironmentValue\"},\"operation\":{\"uuid\":\"b9f830f3-14b2-11f0-b87c-255a5e178b59\",\"parent_uuid\":\"b9f830f0-14b2-11f0-b87c-255a5e178b59\",\"lhs\":{\"uuid\":\"b9f830f4-14b2-11f0-b87c-255a5e178b59\",\"parent_uuid\":\"b9f830f3-14b2-11f0-b87c-255a5e178b59\",\"lhs\":{\"uuid\":\"b9f830f5-14b2-11f0-b87c-255a5e178b59\",\"parent_uuid\":\"b9f830f4-14b2-11f0-b87c-255a5e178b59\",\"value\":\"tags_item\",\"comparison_value_type\":\"EnvironmentValue\",\"full_environment_path\":\"tags_item\"},\"rhs\":{\"uuid\":\"c9da8180-14b2-11f0-b87c-255a5e178b59\",\"parent_uuid\":\"b9f830f4-14b2-11f0-b87c-255a5e178b59\",\"value\":\"[\\\"medium\\\",\\\"Large\\\",\\\"Huge\\\",\\\"Gargantuan\\\"]\",\"comparison_value_type\":\"LiteralValue\"},\"value_type\":\"EnvironmentScalarDefinition:String\",\"operator\":\"in?\",\"operation_type\":\"Comparison\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"},\"operator\":\"ANY\",\"operation_type\":\"ArrayExpression\"},\"operator\":\"AND\",\"operation_type\":\"LogicalExpression\"}"}],"task_id":"shopify::flow::condition","task_version":"0.1","task_type":"CONDITION","description":null,"note":null,"name":null},{"step_id":"e7047a90-14b2-11f0-b87c-255a5e178b59","step_position":[720,0],"config_field_values":[{"config_field_id":"product_id","value":"product.id"},{"config_field_id":"metafield","value":"{\"namespace\":\"test_data\",\"key\":\"binding_mount\",\"type\":\"single_line_text_field\"}"},{"config_field_id":"value","value":"{% if product.tags contains 'medium' %}medium{% endif %}\n{% if product.tags contains 'Large' %}Large{% endif %}\n{% if product.tags contains 'Huge' %}Huge{% endif %}\n{% if product.tags contains 'Gargantuan' %}Gargantuan{% endif %}"}],"task_id":"shopify::admin::add_product_metafield","task_version":"1.0","task_type":"ACTION","description":null,"note":null,"name":null}],"links":[{"from_step_id":"3feaebe0-14b2-11f0-b87c-255a5e178b59","from_port_id":"output","to_step_id":"ab1e28a0-14b2-11f0-b87c-255a5e178b59","to_port_id":"input"},{"from_step_id":"ab1e28a0-14b2-11f0-b87c-255a5e178b59","from_port_id":"true","to_step_id":"e7047a90-14b2-11f0-b87c-255a5e178b59","to_port_id":"input"}],"patched_fields":[],"workflow_name":"Update product metafield for certain tags"}}