Solved

Using Shopify Flow To Change Fulfillment Location

Johnnyw11
Tourist
5 0 1

Hi Guys

 

I'm trying to use Shopify Flow to change the fulfilment location of an order bas on order conditions.

We sell art prints and use various different Print on Demand Companies to fulfil the prints.

 

Example

If the order contains the optionValue "Unframed" we want to send it to POD_Company_1

If the order DOES NOT contain the optionValue "Unframed" we want to set the order location as POD_Company_2

 

I have made the attached flow but I keep getting the same error message:

This action is missing FulfillmentOrder data. To get the FulfillmentOrder data:

  • Change your trigger
  • Add a “get data” action and call this action inside a “for each” loop.

However you can see that i have a Get fulfilment order data action already in place?

 

Please could anyone advise what I'm doing wrong?

 

Many thanks in advance

Johnny

 

Screenshot 2024-04-10 at 19.06.24.png

Accepted Solution (1)

joshbeckman
Shopify Staff
26 4 8

This is an accepted solution.

Hi @Johnnyw11 ,

 

The action Move Fulfillment Order operates on fulfillment orders (not an order itself). An order can have one to many fulfillment orders. So, you can insert a For Each step before that action and iterate over all the fulfillment orders attached to the order, and use the Move Fulfillment Order action on each.

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 9 (9)

joshbeckman
Shopify Staff
26 4 8

This is an accepted solution.

Hi @Johnnyw11 ,

 

The action Move Fulfillment Order operates on fulfillment orders (not an order itself). An order can have one to many fulfillment orders. So, you can insert a For Each step before that action and iterate over all the fulfillment orders attached to the order, and use the Move Fulfillment Order action on each.

To learn more visit the Shopify Help Center or the Community Blog.

Johnnyw11
Tourist
5 0 1

Hi @joshbeckman 

Thank you so much for your fast reply.

I'm sorry though I really don't follow.

What is it you mean with the following?

 

"So, you can insert a For Each step"

 

Which action do I need to insert and where?

If you can an example that would be incredible.

 

Thanks again, your time to reply is very greatly appreciated.

 

Kind Regards

Johnny

joshbeckman
Shopify Staff
26 4 8

Here's documentation about For Each: https://help.shopify.com/en/manual/shopify-flow/reference/actions/for-each

 

To learn more visit the Shopify Help Center or the Community Blog.

Johnnyw11
Tourist
5 0 1

Thanks again for the link @joshbeckman 

I've gone through the article and put the flow together as the article has suggested but I can't get rid of that same error message.

Below is the latest flow i've put together as suggested in the article and by your comment above.

 

Screenshot 2024-04-10 at 21.49.24.png

 

Below is a screen shot of a custom attribute value I'm searching for in each orders line item to decide which fulfilment location the order needs to be assigned to which I hope helps.

 

Screenshot 2024-04-10 at 21.51.03.png

 

Thanks very much in advance once again for any suggestions on how to fix this.

 

Kind Regards

Johnny

joshbeckman
Shopify Staff
26 4 8

So, you don't need to 'Get order data' (fetch a list of orders) because you _already_ have the order (from 'Order created').

 

Instead, remove the `Get order data step' and use the For Each to iterate over the order's fulfillments.

To learn more visit the Shopify Help Center or the Community Blog.

Johnnyw11
Tourist
5 0 1

Brilliant, many thanks @joshbeckman I have got rid of the error, guess I just need to wait and see if it works once orders start coming in and make sure I have the correct condition set to pick up those custom attributes that are associated with each line item.

Thanks again for your help.

 

Screenshot 2024-04-10 at 22.28.58.png

Johnnyw11
Tourist
5 0 1

@joshbeckman  Ok so I got an order in and the flow didn't work unfortunately.

Screenshot 2024-04-11 at 22.28.31.png

 

@Kalen_Jordan It sounds like you have spotted something of why this may be, could you elaborate on which action I would need to put and where abouts in the flow, it would be very greatly appreciated.

 

Thanks again in advance guys.

joshbeckman
Shopify Staff
26 4 8

Based on that screenshot it looks like you still have the For Each step iterating over some data _other_ than the order's fulfillments/fulfillmentOrders? (The step's description reads `For each item in getOrderData` when it should read something like `For each item in order.fulfillments.fulfillmentOrders`...)

 

Or, it's possible there were no fulfillments/fulfillmentOrders on that order? While debugging this, you could use the Log Output task to print out the data that is being passing into the workflow run to see exactly what's available.

To learn more visit the Shopify Help Center or the Community Blog.

Kalen_Jordan
Shopify Partner
452 16 66

But you can only have a single step under the For Each, so you may need a Run Code step before that to loop over the fulfillments and determine which ones need to be moved and output an array of those. Then you can loop over those and do the move action.