Hi everyone,
I’ve had some trouble setting this up. I was able to create an order-triggered flow that queries for the orders in the past year based on customer-id and sums them up but couldn’t do it for scheduled-at-triggered flow.
I’ve added “Get customer data” as a step and then tried using the “for each” loop to get order data for the past year and then sum the amounts but was not able to make it work (it’s actually succeeding and summing up something but none of the test customers have anything changed). I attached the screenshot of the flow (it’s a short video since .png was not supported). Also, the code in the “Get order data” step is:
{% for getCustomerData_item in getCustomerData %}
{% for orders_item in getCustomerData_item.orders %}
getCustomerData_item.id:{{orders_item.customer.legacyResourceId}} AND created_at:>=‘{{ “now” | date_minus:“1 year” }}’
{% endfor %}
{% endfor %}
All the best to all!