Why isn't my date comparison flow working in Shopify?

Whiskey22222
Visitor
1 0 1

so i need to make flow, that checks if date in product metafield was before now, and if so add tag to it.

Whiskey22222_1-1704899572638.png

i created this flow with shopify chat assistant, and its not working
this is metafield

Whiskey22222_2-1704899616555.png

whats wrong?

Reply 1 (1)

Alejo_Wunderlic
Shopify Staff
5 1 1

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.

Alejo 😄
Did my information help? please do not hesitate to let us know. Remember that you can reach out to our help center for more help