Add multiple values to a custom metafield | Flow Automation

Topic summary

Problem: A user attempted to use Shopify Flow to automatically populate a list-type metafield (filters.farbe) with multiple color values from another metafield (custom_label_2). Products with multiple colors (e.g., black and beige) should receive all applicable values, but only one value was being added.

Initial Approach: The workflow used separate conditional branches for each color, which only executed one action instead of capturing all matching colors.

Attempted Solution: Following advice to consolidate logic, the user tried implementing a “Run code” action with JavaScript to check multiple color values and build a list. However, this resulted in errors due to missing input query definitions and metafield type mismatches.

Resolution: The user’s development team found an alternative solution by creating a new metafield that captures values from the existing metafield as list values, with additional logic to add “multicolor” when products have multiple colors. The exact automation method (one-time vs. ongoing) wasn’t fully detailed.

Open Question: Another user later asked for more specifics about the final solution and whether it runs automatically on product creation/updates, but this remains unanswered.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

There is a box labeled define inputs: