Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How to accurately detect single item orders in Flow?

How to accurately detect single item orders in Flow?

MiddMix
Tourist
6 0 2

Hi! I'm working on developing a system to automatically tag individual items as 'Single' along with their SKU. This is to streamline our labeling process by enabling us to quickly identify single-item orders. However, I'm facing an issue: the system isn't accurately counting the total number of items in an order. It's supposed to tag orders containing only one item, but it's mistakenly tagging orders that have multiple items, provided there's only one of each SKU. Can anyone help me figure out what's going wrong?

 

Capture2.PNG

Capture1.png

  

Replies 9 (9)

paul_n
Shopify Staff
1429 156 332

That trigger might run multiple times for an order and could be leading to your problems. Can you share a screenshot of what's in that condition ?

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.
MiddMix
Tourist
6 0 2

Thank you for your response! Here you go

 

Capture3.PNG

MiddMix
Tourist
6 0 2

It is also sometimes not running at all, we have single item orders that are not being tagged.

paul_n
Shopify Staff
1429 156 332

It won't run until the fulfillment order is released from an initial hold. I would switch the trigger to Order created.

 

order.currentSubtotalLineItemsQuantity should work. I would switch triggers and go to the order that wasn't tagged and click "Run Flow automation" and choose the workflow (with the new trigger). If it tags, you know it works for that scenario.

 

If it doesn't work, look at the workflow run details and it will show you what value is present in that field. If something doesn't make sense, post it back to this thread

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.
MiddMix
Tourist
6 0 2

This seems to work! Thank you very much! Will accept as solution after a bit more testing. 

MiddMix
Tourist
6 0 2

Paul! The flow is working when I manually run it, the problem is now its not working when its triggered on its own. I have attached the flow report of it showing a successful tag. The order was never tagged though..

paul_n
Shopify Staff
1429 156 332

The attachment did not come through. If Flow said it successfully tagged, >99% of the time it did and another app overwrote it. To get around that, you may want to add a wait step to be the last to add tags.

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.

Kalen_Jordan
Shopify Partner
779 36 141

I'm curious what the reasoning is for wanting to tag these types of orders? I had someone else ask about this recently and I was curious about it.

MiddMix
Tourist
6 0 2

To speed up fulfilment. If we know we have 100 of the exact same order we can batch them all in an assembly line fashioned.