Query filtering by date

Query filtering by date

benalexanderjon
Tourist
10 0 3

I am building a flow that will tag book products if they are published after today's date.

 

In this case, the publication date refers to the date the publishers publish the book. Not when the product was published on Shopify.

The book publication date is stored as a date in metafields.custom.book_publication_date.

 

I have added an advanced query to get product data:
metafields.custom.book_publication_date.date:>={{ 'now' | date: "%Y-%m-%d" }}

 

This should return product with a publication date greater than today, but it doesn't. In the screenshot below, it returns products with a publication date before today (22/5/25):

Screenshot 2025-05-22 at 13.25.02.png

Replies 2 (2)

RPiii
Shopify Staff
162 27 49

Hi @benalexanderjon👋 You provided additional context in another thread that you're looking to query by a metafield value. The query on the Get product data action only accepts filters supported by the Admin API. Unfortunately, querying by metafield value is not supported.

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. 😅

benalexanderjon
Tourist
10 0 3

Sounds good. What do you need from me to take a look?