Month to date order count in Shopify Flow

Month to date order count in Shopify Flow

monnedepraetere
Tourist
9 0 1

How can I calculate the month-to-date order count in Shopify Flow and use this as a condition?

 

Context: we have apps with big fee hikes for monthly order count > 250. However, we can exclude orders from that count if we apply a specific tag to them. Therefore, whenever the month to date order count equals 250, we want to start tagging orders. Obviously, at the start of the month, the tagging should stop again.   

 

Example workflow:

[trigger] order created

-> [condition] if month to date order count > 250

-> if true [action] add order tag

Replies 2 (2)

paul_n
Shopify Staff
1172 143 276

I'm not sure there is an easy way to do that currently, since Flow's "Get order data" action is limited to 100 at a time.  You could instead create a shop metafield that you increment for each new order that month. The hard part is tracking the rollover from month to month. Another option would be to run "Get order data" daily to get the daily count and then set the metafield/tag based on that count. 

 

Something like:

  • Every day
  • Get order data 
  • Count(order data)
  • If count > 1
    • Update metafield with count
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.
monnedepraetere
Tourist
9 0 1

Thanks @paul_n, will give that one a try!