What's your biggest current challenge? Have your say in Community Polls along the right column.

shopify synthax query code not working helppp

shopify synthax query code not working helppp

bmr34
Visitor
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?

unknown_2023.12.25-14.08.png

Replies 9 (9)

PaulNewton
Shopify Partner
7516 662 1577

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  {{getCustomerData_item.email}}\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"}}

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


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

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


paul_n
Shopify Staff
1445 157 334

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.
CarmineT
Shopify Partner
96 2 29

I have same issue because I try to "fix" the welcome marketing block that is not triggering anymore when a customer subscribe.

Before I was selecting 100 customer but as SQL in your backend is done randomly I was try to improve it.

 

sot please, what I should change here to make it work(select the subscribed customer of last day)

 

customer_date:<='{{{{customer.createdAt}}}} }}' AND customer_date:>'{{ customer.createdAt | date_minus: "1 day" }}'

paul_n
Shopify Staff
1445 157 334

I don't know what you are trying to say there about SQL and the welcome marketing block. Or what "sot" means.

 

Why are you using so many brackets in your liquid?

customer_date:<='{{{{customer.createdAt}}}} }}'

 

This is more valid but you also may not need it (since it may be effectively saying "get all customers created before now").
customer_date:<='{{customer.createdAt}}'

 

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.
CarmineT
Shopify Partner
96 2 29

Hi Paul_n

 

I try to explain myself better.

 

This code generate by shopify itself:

 

customer_date:<='{{{{customer.createdAt}}}} }}'

 

so if you ask, then ask internally at shopify ;).

 

About the SQL, nevermind, what i mean is I used a  get customer block that as long I know, it query data data that satisfied .

As any query language usually the order is not guaranteed but probably this is another topic.

 

The point is, why the welcome automation marketing flow(not flow app, but marketing automation) is not working, anymore is a mistery.

No error whatsoever.

 

Bear in mind I tried with a never used test email, with no lack.

 

Hope to have some good insights.

If you have any chance please let know your managers that as a shopify avocate and Partner,  I am starting to have concern regarding the quelity of feature and further develop at Shopify.

 

Lot of things not working anymore or stopped to work.

Support closing chat or not answering etc

 

Maybe your stackholder really do believe everything will be run by AI, wondering who do they will sell if merchants

won't be there anymore.

 

 

paul_n
Shopify Staff
1445 157 334

That code should not be inserting into your UI. I double-checked and do not see any action that inserts that. 

 

Welcome automation should be working, but I haven't seen anything above suggesting otherwise. It seems like language may be a problem here, so you might have better luck reaching out directly to support. Or spend a bit more time outlining whatever issue you are seeing. 

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.
CarmineT
Shopify Partner
96 2 29

That code is generated at marketing automation block within Shopify admin API.

 

The welcome automation I set, did worked last time Saturday, then as I was running some ads and have organic visit, and signed people it should have worked, but nothing.

I then tested with an email, subscribed and "surfed", no emails that is set in this case

DongfangZ
Shopify Staff
9 3 1

Hi, have you tried using the "Welcome new subscriber" automation template?

To learn more visit the Shopify Help Center or the Community Blog.

CarmineT
Shopify Partner
96 2 29

yes that one, it stopped to work recently for no reason