How to create a workflow for daily check users buying sum within the last 365 days?

How to create a workflow for daily check users buying sum within the last 365 days?

robinthebest
Tourist
8 0 3

Recently I've been trying to apply a VIP tier level to our website, my rules was supposed to be: User who reached $10000 spending in the last 365 days, will automatically add a "Silver VIP" to the customer, at the same time i applied a code to the checkout page, customer with this tag can auto apply a 10% discount to their order. Which already works.

 

However, I couldn't figure out how do I apply the flow correctly, for example:

The customer spent $8000 on 2024 Jan 1, and spent $2000 on 2024 Sep 1, therefore the system should add a vip to this customer, which the template flow could do so, however, on 2025 Jan 2, the customer trying to buy items, due to the tag is still on his account, it automatically gave him a 10% discount, which i didn't want to due to he spent 10000 on prior 366 days instead of 365, how do I prevent this situation happens?

 

The template flow triggers is always start from order start instead of daily trigger, but daily trigger seems doesn't work on this way, any idea on how to do this?

Replies 4 (4)

Taknify
Shopify Partner
274 19 29

Well, the code is working as expected. Using the Flow, you tagged the users who reached $10000 in one year and the code applies the discount based on tag. You can limit the discount code to be only one time use so it doesn't add it next time. 
You need to create a flow, that deletes the tag again or add code to tag and untag users once they receive their first discount.
Do press that like button, if this answer helps you.
DM us if you want me to implement that for you.

Need to tweak your store for Black Friday? Simply, send me a message.

Kalen_Jordan
Shopify Partner
803 39 147

You could do it as a scheduled trigger that runs every 10 minutes and paginates through your customers 100 at a time, if you have less than 14.4k customers that should work.

robinthebest
Tourist
8 0 3

Hi can u give me an idea on how the flow should start? Because I get order invalid when I use the template

 

robinthebest_0-1719895588063.png

 

Kalen_Jordan
Shopify Partner
803 39 147

I can prioritize this faster on a paid basis if that's of interest. There's a link in my footer.