Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How can I create a product tag that contains a dynamic creation date using Flow?

Solved

How can I create a product tag that contains a dynamic creation date using Flow?

Kerri_NF
Visitor
2 1 2

We sell custom neon signs and use personalisation tools to do this, which means every time someone adds their design to their basket it is saved as a brand new product (regardless if they order or not).

 

I'm trying to set up a Shopify flow so that every time a new product is created it's tagged with "Created [DYNAMIC DATE}" Ideally something that would read like "Created 7 April 2024" for example.

 

I found a load of advice in using liquid syntax to do this, and the flow is working but it's not actually pulling the dynamic date into the tag label. It appears exactly as typed.

This is the kind of thing I've been using:

Created { product.created_at | date: "%b %d, %y" }

Created { product.created_at | date: "%Y-%m-%d" }

 

I've tried product.createdAt and loads of different date variants that match PHP formats, but no luck! All my labels come out saying exactly what I set as the tag, not with dynamic dates.

 

Screenshot 2024-04-09 at 11.47.23.png

Screenshot 2024-04-09 at 11.50.55.png

 ag

 

Does anybody have any advice (that isn't another app or reporting tool)?

 

Cheers,

Kerri

Accepted Solution (1)
Kerri_NF
Visitor
2 1 2

This is an accepted solution.

That makes sense why it wasn't working! Thanks for the advice, I looked for the variable in flow and it's working now!

 

For anybody else searching this how to automatically tag products with their creation date in Shopify using Flow:


{{product.createdAt | date: "%d-%m-%y"}}

 

 

 

Cheers Paul!

 

View solution in original post

Replies 2 (2)

paul_n
Shopify Staff
1433 157 332

You've made up some variables that don't exist in Flow. If you are unsure about variable names, use "Add a variable" to add them. It will show you the syntax, which in this case is {{ product.createdAt }}

 

Note that the brackets are {{ and }} not { and }. I'm not sure what your are referring to with PHP, but this is Liquid not PHP. See https://shopify.github.io/liquid/filters/date/

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
Kerri_NF
Visitor
2 1 2

This is an accepted solution.

That makes sense why it wasn't working! Thanks for the advice, I looked for the variable in flow and it's working now!

 

For anybody else searching this how to automatically tag products with their creation date in Shopify using Flow:


{{product.createdAt | date: "%d-%m-%y"}}

 

 

 

Cheers Paul!