[ { "label": "Setting product metafields from product tags", "trigger_type": [ "product_custom" ], "object_type": "product", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "product.tags_array", "settings": { "multiple": "any", "operator": "starts_with", "value": "location_", "long_value": "", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "product_set_metafield_value", "settings": { "token_object_type": "product", "metafield_selection_type": "custom", "namespace": "custom_fields", "key": "location", "value_type": "string", "value": "{% for product_tag in product.tags_array if product_tag|contains('location_') %}\r\n {{ product_tag|replace({'location_':''}) }}\r\n{% endfor %}\r\n", "wait": "0", "cw_timezone": "America\/New_York", "custom_wait": "" }, "weight": 999, "target_key": "product" } } } }, "shared_workflow_id": 39005 }, "description": "This automation will convert any tags starting with 'location_' into a product metafield value, stripping of the 'location_' part." } ]