Validation error when trying to update Collection metafield with Schedule as trigger

Validation error when trying to update Collection metafield with Schedule as trigger

peters
New Member
5 0 0

I'm trying to create a flow that based on a schedule updates some collection metadatafields. But when I connect a Schedule trigger => Get collection data > Update collection metafield I get the error shown in the screenshot below:

 

peters_0-1678179586768.png

 

If I however change the first trigger step to e.g. "Collection created" then I don't get the error, so I assume it's an issue with Schedule as a trigger for these types of updates. Any insight here or suggestions for workarounds?

 

Thank you in advance.

Reply 1 (1)

c_maiolo
Shopify Staff
4 0 3

Hi Peters. The Update collection metafield action acts on a specific collection, so it needs to know what collection to use. The get collection data action fetches a list of collections, so you must first add a for each action to iterate over each of the collections fetched and attach the Update collection metafield action to that step where it says "do this for each item". That way it will perform the action for each of the collections. You can see a similar example in the for each docs.

To learn more visit the Shopify Help Center or the Community Blog.