Tags: Auto-Tag, Companies, Metafields, Orders
When new orders are created, this task will check to see if any of the configured metafields are set on the company which placed the order, and if so then it will add order tags based on the metafield values.
- View in the task library: tasks.mechanic.dev/auto-tag-new-orders-with-company-metafield-values
- Task JSON, for direct import: task.json
- Preview task code: script.liquid
{
"metafields_and_tag_prefixes__keyval_required": null,
"truncate_long_tags__boolean": null
}
Learn about task options in Mechanic
shopify/orders/create
mechanic/user/order
Learn about event subscriptions in Mechanic
When new orders are created, this task will check to see if any of the configured metafields are set on the company which placed the order, and if so then it will add order tags based on the metafield values.
Configure this task by adding company metafields on the left, in the form of namespace.key, and the optional paired tag prefixes on the right. Prefixes should include a divider and/or spacing as needed (e.g. "Batch: ", "attn_").
This task supports the following metafield types - "boolean", "date", "date_time", "number_decimal", "number_integer", and "single_line_text_field". List versions of each type are also supported (e.g. "list.single_line_text_field"). List metafields with multiple values set on the company will result in an order tag being added for each value.
IMPORTANT: Shopify limits order tags to 40 characters. If a tag (including the optional prefix) exceeds that length, then that tag will not be set on the order. Enable the "Truncate long tags" option to have the task truncate tags to a maximum of 40 characters. Truncations are made from the right side of the tag.
Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.
Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.
Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!