GetOrderData for order older then X days + fullfilled

Topic summary

Goal: Build a Shopify Flow “Get order data” advanced query to return fulfilled orders older than X days, and optionally within a specific date window.

Key fixes/answers:

  • Using date_plus caused a future date and zero results. Use date_minus (e.g., created_at:>=‘{{ scheduledAt | date_minus: “1 week” }}’ AND fulfillment_status:shipped).
  • To filter a time range (e.g., older than 8 days but not more than 2): chain two conditions with AND, such as:
    • created_at:<=‘{{ “now” | date_minus: “2 days” }}’ AND
    • created_at:>=‘{{ “now” | date_minus: “8 days” }}’ AND
    • fulfillment_status:shipped
  • “now” must be used within a Liquid filter; using bare now in the query won’t work.
  • For other data blocks (e.g., Get customer data) you can query on fields like updated_at if that field exists on the object. Consult docs for available variables/fields.

Docs shared:

Status: Practical solution and references provided; exact list of queryable fields is deferred to documentation.

Summarized with AI on December 14. AI used: gpt-5.

Hi everyone,

I am trying to use GetOrderData to get orders older then X days + fullfilled to afterwards for example add them to a spreadsheed or simply archive them and am struggling a bit how to do it.

My idea is to use an advanced query but somehow I get 0 returns although there are several orders existing:

created_at:>='{{ scheduledAt | date_plus: “1 week” }} AND fulfillment_status:shipped

Help would be highly appreciated!

Armin

You want date_minus not date_plus since that would be in the future.

I actually used created_at:>=‘{{ scheduledAt | date_minus: “2 days” }}’

and still get also the order from when the flow is run to -2 days.

So the better question, is possible to filter out orders that in a particular time frame, let’s say:

older then 2 days but not more then 5?

You can filter by the same variable twice. So add something like created_at:>=“somedate” AND created_at:<=“another date”

Yep, indeed I used followinf code in the advance query box of the get order data

created_at:<=‘{{ “now” | date_minus: “2 days” }}’ AND
created_at:>=‘{{ “now” | date_minus: “8 days” }}’ AND

My question is, as I learn that searching around and check others template, there is a doc where I can see the parameter I can use in that box.

For example the “now” parameter does work as in popular software day() or today() etc

using only now does not work.

Also having the get customer date and write a query one must use proper object parameters.

For example if I have the bloc get customer data, sorting by last order date,

how I know which parameters I can further query,

is this correct/ accepted because the customer order has also an updated_at field?

updated_at:<=‘{{ “now” | date_minus: “2 days” }}’ AND
updated_at:>=‘{{ “now” | date_minus: “8 days” }}’ AND

I missing are those the API of shopify GraphQL implementation or some sort of “dialect”

I hope my question does make sense.

Two good references:

https://help.shopify.com/en/manual/shopify-flow/reference/variables

And https://shopify.github.io/liquid/