Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Is there a way to trigger an action based on when was the previous order date (not the one that triggered the flow)?
I saw order.customer.lastOrder or order.customer.orders - I don't think those can be used in actions because I would need to get some info about the previous orders (-1, -2).
Is there a workaround for this?
Thanks!
You can do this using graphql Api , use all order api and , in that you will get the link to to privious and next order using that you can get date and order no something as below , where hasNextPage and hasPreviousPage shows next and previous order :
{
orders(first:5){
edges{
node{
name
}
}
pageInfo{
hasNextPage
hasPreviousPage
}
}
}
A good example of workflow using those fields is Organize customers by order count tiers where, using order created as a trigger, we can setup an action that is based on the total order count of a customer, which of course is the count of all orders until the last + 1.
Similarly a condition can be setup using customer.lastOrder as you correctly suggested, which will allow you to leverage, within a workflow triggered by Order Created, all fields related to the customer's last order: including createdAt etc.
To learn more visit the Shopify Help Center or the Community Blog.
User | RANK |
---|---|
3 | |
2 | |
2 | |
2 | |
2 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023