so i need to make flow, that checks if date in product metafield was before now, and if so add tag to it.
i created this flow with shopify chat assistant, and its not working
this is metafield

whats wrong?
Unfortunately, Liquid, the Shopify templating language, does not allow for direct read and write operations on a product’s metafields or for date comparisons.
Manipulating metafields and date comparisons are operations that are typically done in the backend of an application using the Shopify API, in a language like Ruby, Python, or Node.js.
While you can access metafields in a Liquid template, you can’t use them to trigger actions like adding a tag to a product.
This task would require a custom solution, possibly a custom app, that uses the Shopify API to periodically check the date in the product metafield and add a tag if necessary.
and there is also no way to use a “run Code” Action node and Javascript for this? thx
This question was asked before Run code was a feature. Doing date maths and comparisons is one area that Run code is useful in Flow, yes.
thanks. can you give me a heads up where I can find tutorial how to do that? (In a flow that runs once a day, I would like to compare a date value that is in custom metafield on all products and trigger an action in a flow when that date is in the past.)
thx!
yes, far more than 100 products. I want to check once every day. if the date in the metafield is in the future, then add the tag “preorder” to the product (if not already existing). If the date is today or in the past: delete the tag “preorder” that might be on the product. The dates can change, so I need to check all products every day.
Shopify Flow does not provide an easy way to iterate over all products, since the Get product data action has a limitation of a maximum of 100 selected products. You can search the forum for a way to overcome this limitation using only Shopify Flow.
If you don’t mind third-party apps, the Flow Companion app provides the Start custom workflow for list of products action, which has no limit on the number of products in the selection. With this action, you can update the preorder tag for all products on a daily schedule.
Here’s how this can be done:
On a schedule, run the Start custom workflow for list of products action with the following parameters:
Trigger specifier: actualize preorder tag (you can use any value, the main thing is that it matches in this action and in the condition applied to the trigger value later)
String parameter: {{scheduledAt}} (we will use this value in the launched workflow later to compare it with the value from the metafield)
Query: in my example I left it empty so that all products are selected, but you can enter filter conditions here.
Start the next workflow with the Product: custom trigger triggered trigger and check that the Specifier equals actualize preorder tag.
Product → Metafield).
Release date of type Date.
additionalParameters.stringParameter and the metafield value from input.product.releaseDate.value. There may be confusion with time zones. If you run into difficulties with time zones, let me know your time zone and I’ll try to help.
preorder tag, add or remove this tag.
You can reach out to Flow Companion support if you have questions about setting up your specific workflow.
This repository has a few run code examples that might help you understand how it works
sorry, If I missed something obvious: What repository? Thx
The error message says that you are using a trigger that does not contain a product. In my example above, the trigger Product: custom trigger triggered is used, which provides a product to the workflow.
Please show the entire workflow and describe what you want to achieve. If it’s more convenient for you, you can do this privately by sending the details to our support. You can find the support email address in the information on my profile.
That solved it, but now I have issue where not all my products have a release date set yet. I’m trying to figure out at what stage I need to have it check for and eliminate products that don’t have release dates set, or if there is a way to go set them all to sometime in the past and then add them to all items as we create them. Thank you for any assistance you can provide and I’m super greatful for this thread I’ve been trying to find an answer to tagging preorders for months
Step 1 - If I want to only check specific product types what would that filter condition look like?
I’m trying to figure out at what stage I need to have it check for and eliminate products that don’t have release dates set
You can add a condition for the metafield value being filled right after the Log output action.
Step 1 - If I want to only check specific product types what would that filter condition look like?
You can apply a condition to any field from the query section here. The syntax for how to apply conditions can be found here. For example, if you want to apply a condition to the product category, the value in the Query field could look like category_id:sg-4-17-2-17.
off sitewide
July sale — 45% off at checkout, applied automatically. Valid for 60 minutes. One per customer.
Offer ends in