shopify synthax query code not working helppp

1 0 1

i selected the query "Created in the last week" (about customers) and it made me some code
customer_date:<='{{ scheduledAt }}' AND customer_date:>'{{ scheduledAt | date_minus: "1 week" }}'

but then an error pops up that says
"scheduledAt" is invalid. Replace this variable.

i searched on the internet and chatgpt to fix this synthax but they all made it worse

Anyone knows how to fix this?

And also, why would shopify make the template code broken?


Replies 2 (2)

Shopify Partner
6274 572 1309

Click the "Add a variable" action in the edit query UI.

If scheduledAt is not in that list, then there is no schedule data available to that part of your flow.


If the Scheduled time trigger is directly connected to what has this issue, probably try and hard reload the shopify flow url; and test in a different browser.


Since we can't attach flows files here, an example flow JSON, save contents unformatted to a file with  .flow extension to import into shopify flow:

Schedule customer query to Log output.flow

2fc8ff5c92cad7781b93dfe43c01e98567082a5352ccc08dc9aab72491ff9ef7:{"__metadata":{"version":0.1},"root":{"steps":[{"step_id":"0e8b3d00-a363-11ee-afa6-bf6712f80a55","step_position":[900,1240],"config_field_values":[{"config_field_id":"recurrence","value":"[\"DTSTART;TZID=America/New_York:20231225T120000\\nRRULE:FREQ=HOURLY;INTERVAL=1;WKST=MO\"]"}],"task_id":"shopify::flow::scheduled_time","task_version":"0.1","task_type":"TRIGGER","description":null,"note":null,"name":null},{"step_id":"1528a8a0-a363-11ee-afa6-bf6712f80a55","step_position":[1260,1240],"config_field_values":[{"config_field_id":"sort_by","value":"{\"sortKey\":\"CREATED_AT\",\"order\":\"ASCENDING\"}"},{"config_field_id":"max_root_records","value":"10"},{"config_field_id":"query","value":"customer_date:<='{{ scheduledAt }}' AND customer_date:>'{{ scheduledAt | date_minus: \"1 week\" }}'\n"}],"task_id":"shopify::flow::fetch::customers","task_version":"v1","task_type":"ACTION","description":null,"note":null,"name":"Get customer data"},{"step_id":"273db7b0-a363-11ee-afa6-bf6712f80a55","step_position":[1620,1240],"config_field_values":[{"config_field_id":"message","value":"{% for getCustomerData_item in getCustomerData %}\n  {{}}\n{% endfor %}\n\n{{ getCustomerData | json }}\n"}],"task_id":"shopify::flow::print","task_version":"0.1","task_type":"ACTION","description":null,"note":null,"name":null}],"links":[{"from_step_id":"0e8b3d00-a363-11ee-afa6-bf6712f80a55","from_port_id":"output","to_step_id":"1528a8a0-a363-11ee-afa6-bf6712f80a55","to_port_id":"input"},{"from_step_id":"1528a8a0-a363-11ee-afa6-bf6712f80a55","from_port_id":"output","to_step_id":"273db7b0-a363-11ee-afa6-bf6712f80a55","to_port_id":"input"}],"workflow_name":"Schedule customer query to Log output"}}


Save time & money ,Ask Questions The Smart Way

Confused? Busy? Get the solution you need

Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to

Shopify Staff
788 118 189

As it says when you select that query, you need to use it with a schedule time trigger. 


What are you trying to do? 

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.