Scheduled to run order flow that adds a tag

Scheduled to run order flow that adds a tag

RazvanTenq
Tourist
10 0 3

Hello everybody,

 

I am trying to build a flow that runs every one hour and tags the orders if all order items inventory is greater than 0. Basically if all the products in the order are in stock.

 

I made this but it is not working.

RazvanTenq_0-1713370720283.png

 

Very appreciated your help.

 

Thanks

 

Razvan

Replies 7 (7)

paul_n
Shopify Staff
1336 151 305

What is not working?

 

The inventory check likely needs to be inside of the for each loop

 

But you could also potentially run this when the order is created (thus once per order, avoiding need to query/loop)

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.
RazvanTenq
Tourist
10 0 3

I also have a flow that runs when order is created and tags the order. That one is working well.

I also receive inventory from my suppliers every day and i need to run the flow to tag the orders that were not tagged by the first flow.

paul_n
Shopify Staff
1336 151 305

Thanks, but what is not working?

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.
RazvanTenq
Tourist
10 0 3

I don't know where the problem is. It just won't tag the orders. What info do you need me to give you in order to give me a hint?

paul_n
Shopify Staff
1336 151 305

Open the workflow run. It likely tells you why it didn't tag. If you are confused, include an image of what is confusing here.

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.
RazvanTenq
Tourist
10 0 3

Here is the run:

 

RazvanTenq_0-1713377213958.png

 

paul_n
Shopify Staff
1336 151 305

I see that it added and order tag for that first order. If you aren't seeing the tag, then you have another app that is overwriting tags.

 

Your condition logic is basically:
If any of the returned orders (from Get order data) has all variants in stock

 

Then you loop over all of the orders, regardless of whether they met the condition and add a tag

 

So at the very least, you need to put the condition instead inside the "for each" loop like I said above. Then choose the individual order item from that loop, something like (if all of getOrderData__item / lineitems has an lineItem_item / variant / inventoryQuantity > 0)

 

 

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.