How to use Flow to add product to a collection based on metafields

Topic summary

Goal: Automatically add products to specific collections when product metafields indicate they belong there. Metafields = custom fields on products; Shopify Flow = automation tool for triggers, conditions, and actions.

Key guidance:

  • It’s possible to base collection assignment on metafield values.
  • For bulk/automated updates, build a Flow that:
    1. Uses a Scheduled time trigger to run periodically.
    2. Calls Get product data to retrieve products.
    3. Applies Conditions to check each product’s metafield values.
    4. Runs a For each loop over matching products.
    5. Executes Add product to collections to place each product into the relevant collection(s).

Notes:

  • An illustrative screenshot (flow diagram) was provided showing the trigger → data fetch → conditional checks → loop → add-to-collection actions.
  • This approach addresses cases where the UI appears to only allow manual assignment by automating it via Flow actions.

Outcome/status: The original poster acknowledged the guidance with thanks, indicating the solution answered the question. The discussion appears resolved.

Summarized with AI on December 18. AI used: gpt-5.

Hi,

Let’s say I have metafields of collection 1 and collection 2 on products. How can I use flow to check for those metafields and if they exist, add the product to those collections? I see the option to manually add the collection but not to automate it with metafields. Thanks!

1 Like

You can just define the collection based on those metafield values.

If you want to run bulk updates manually, you could start with a Scheduled time trigger and a Get product data action. Then you’d want to define conditions that evaluate the returned products for the desired metafield value and start a For each loop that executes an Add product to collections action for each product and adds it to the relevant collection.

Here’s an illustrative example:

Thank you!

1 Like