Each book has a custom metafield data point for the publication date of the book (this is when the book was published by the publishers, not published to Shopify)
I would like to write an advanced query for get product data that filter products that match the following:
metafields.custom.book_publication_date - today’s date <= 30.
The flow will tag products whose publication date is within 30 days of today and remove the tag on products whose publication date is not within 30 days of today.
I’ve built the flow, I just need help with the advanced query on the get product data step.
rather than iterate through the 5,000 plus products we have, I thought it better to apply a advanced query filter to the get product data step.
Correction: According to these docs it may be possible to query by metafield value but I’m not sure how to express that query in Liquid syntax in Flow.
Also, please stop starting new threads and instead use the original thread, as it makes it harder to support you with a proper answer.
Sorry, I’m not familiar with these query options. It might be that the lightly documented “query by metafield value” option doesn’t support date types or ranges (such a < or >). You might try using GraphiQL to test out a few queries and see if it works using other metafields, =, or other combinations.
To follow up here, date metafields are not queryable at all. So if this metafield is a date type you cannot yet query. You could potentially store the data as a string, which is supported. However, string values cannot be used with < or >, since they aren’t numbers. Numbers, like dates, are also not queryable yet. Just to make this clear, this isn’t a Flow limitation but one with metafields.
So to do your use case, you likely need to workaround the fact that you can only query dates if they are strings and exactly match your query.