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
6 0 1

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
202 14 25

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 a bit? Come and visit us at Taknify or send me message.

Kalen_Jordan
Shopify Partner
526 18 78

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
6 0 1

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
526 18 78

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