Solved

Flow not accurately checking if ordered items are in-stock

tedvmg
Excursionist
16 1 2

Hi-

I'm trying to configure Flow to check if a newly created order's line items are available in inventory and then use Slack to notify our shipper that the order is ready to go if all items are in stock. I've run into an issue with my test runs where Flow still sends a Slack notification when one of the items in the order is at 0 for "available" in Shopify inventory.

 

I thought it would be as simple as the following, which is still sending messages when the available stock is 0:

 

Trigger (Order ready to be fulfilled) >> Action (Send Slack Message with order name)

 

Do I need to do something like this?

Trigger (Order created) >> Action (Get order data by order number and fulfillable) >> Action (Send Slack message...)

 

What am I missing about how to do this?

Thanks!

Ted

 

Accepted Solution (1)
paul_n
Shopify Staff
916 127 221

This is an accepted solution.

Thanks Dave. Just to show where the inventory is located if you are working with an order, first you need to know if you are checking the product (across variants), variant (across locations), or location inventory. 

 

Product - order / lineItems / product / inventory / totalInventory

Variant - order / lineItems / variant / inventoryQuantity

Location - order / lineItems / variant / inventoryItem / inventoryLevels / available

 

* note that available is deprecated in favor of a field called quantities. I haven't tested it yet to know how it works.

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.

View solution in original post

Replies 5 (5)

paul_n
Shopify Staff
916 127 221

We are working to change the name on that trigger as it implies something that isn't true, since "ready to fulfill" has different meanings for different merchants. What it means is that the order has been processed and line items are assigned to fulfillment orders. 

 

You could check order.fulfillable to see if any lineItems can be fulfilled on the order. You could also check quantity for each lineItem in the order. Just know that if you have a partially fulfillable order, you need to think about how to handle that. 

 

If you provide more detail about your scenario we might be able to help further. 

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.
tedvmg
Excursionist
16 1 2

Thanks, @paul_n

 

When you say"You could also check quantity for each lineItem in the order." do you mean I can check the quantity of inventory for that lineItem?

 

Thanks,

DaveMcV
Shopify Staff
78 25 24

Hi Tedvmg,

 

Yes, I think Paul is suggesting that you could add a Condition that checks each lineItem's quantity before sending the message. You can have it check if all lineItems have quantity available, or at least one -- depending on when you want to send the message. As Paul mentioned, a partially fulfillable order will need to be a consideration you build into the workflow.

 

Hope that helps!

DaveMcV | Flow Development 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.
paul_n
Shopify Staff
916 127 221

This is an accepted solution.

Thanks Dave. Just to show where the inventory is located if you are working with an order, first you need to know if you are checking the product (across variants), variant (across locations), or location inventory. 

 

Product - order / lineItems / product / inventory / totalInventory

Variant - order / lineItems / variant / inventoryQuantity

Location - order / lineItems / variant / inventoryItem / inventoryLevels / available

 

* note that available is deprecated in favor of a field called quantities. I haven't tested it yet to know how it works.

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.
tedvmg
Excursionist
16 1 2

Thanks @paul_n and @DaveMcV, for your help - I'm a newbie with Flow so still figuring a lot out!

 

I'll give it a shot and circle back if I have any more questions.

 

Ted