How to 'Get product data' of products created over 180 days ago

Hello! I’ve been tinkering with this for a few hours now -

I’m trying to remove a tag if the product has been published for over 180 days.

Flow:

  • Scheduled flow, weekly
  • Get Product Data
    • tag:new AND published_at:<='{{ scheduledAt | date_minus: "180 days" }}' AND status:active
      

(I’ve tried multiple variants of the above code)

When attempting to get any ‘published_at’ or ‘created_at’ date, it skips the ‘tag:new’ filter. It returns products, but those returned products do not have the desired tag.

If I run tag:new AND status:active – it returns only products tagged new - that’s great. But why does it break when adding a time? It even breaks the filtering when I add a static time just for testing.

I don’t want to use a conditional, because the ‘get product data’ without a date could return more than 100 products.

Thanks in advance!

Worth noting that even if I did add a conditional, I cannot do ScheduledAt time minus 180 days in a conditional. I’m just trying to get products that have been published for more than 180 days.

1 Like

Filter docs are below. “Published” is not the same as “created”, so not sure which you want, but they are both filters. You can use something like published_at:<={{ scheduledAt | date_minus:”180 days”}}

Hey Paul, thanks for the response! But this yields the same issue, when applying that publish_at - it still breaks the tag filtering. Am I missing something?

If I remove the date, and use tag:new AND status:active- I receive products tagged ‘new’

Yeah, I suspect this is one of those query filters that cannot be combined with others. Unfortunately, the documentation doesn’t clearly call those out.