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