Removing Tags from Duplicate Orders/Drafts?

Removing Tags from Duplicate Orders/Drafts?

Sheffield_Tiger
Shopify Partner
9 0 0

Hi, our backend accounts/dispatch system imports orders from Shopify for processing and tags the order "Imported" once done, as a safeguard against double-importing orders.  This works great normally but occasionally a staff member will need to re-send an order if it is lost/damaged etc.

To do this, they duplicate the original order and 100% discount, but this also brings over the tag from the original order, meaning our order import skips it and never processes the replacement - and this can easily be forgotten.

 

As this creates a duplicate order, it would seem that the best step is to use Flow to remove the tag "Imported" from any newly created order

Start When...
> Order Created

Do this...
> Remove  order tags
   Remove the following order tags: Imported
   (and as a test, Add the following order tags: Test)

However, once the order is created (marked as paid), the flow runs, it ADDS the "test" tag (confirming the flow has been triggered and run) but doesn't remove the "imported" tag

Anyone know what I'm missing here?  I've also tried a flow on draft orders to remove the tag as soon as the duplicate is created as a draft order but with the same effect.

Replies 2 (2)

paul_n
Shopify Staff
1672 183 382

You have two different systems that are running when an order is created. Either the Admin and Flow or the app and Flow. So depending on which one runs first, you'll get different behavior. This is called a race condition. 

I suspect if you see "Imported" after Flow ran, that either the order did not have that tag when Flow ran, or that tag was added back after Flow ran (and it is likely in the downstream system). 

 

There isn't enough detail here to really know how to design this better. Ideally, you could initiate the sync with the backend system directly from Flow

 

 

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.
Sheffield_Tiger
Shopify Partner
9 0 0

Thanks Paul, that makes sense of something that was confusing me at least.

I think our short-term answer is staff training to ensure they manually remove any order tags (or trigger a flow) when creating a duplicate order in the backend.