Multiple Shopify line items + Array is creating multiple Xero POs

Thank you to everyone who has guided me along the way so far. This community is great!

I’m currently trying to extract line items from Shopify and add them to a purchase order in Xero as shown in the flow below.

This is all working perfectly EXCEPT that every Shopify line item is being added to a separate purchase order in Xero. So if there are 3 line items on the Shopify order, I’m getting 3 separate purchase orders in Xero!

Here’s a breakdown of what I’m doing.

The iterator splits out the line items from Shopify…

Xero get an item module is fetching product data from Xero based on the corresponding SKU in Xero

Array is then merging all the data back together again…

And then we’re placing the array data into Xero…

I was EXPECTING a single Xero purchase order with three line items that correspond with the three line items on the Shopify order. What I have instead is 3 separate Xero purchase orders, each with one line item.

Question 1: Any idea how I can get all line items onto a single purchase order?

Question 2: Prior to using iterator + array and mapping line items in Xero (as shown in the last couple of screenshots above), I had set the Xero module up to add a fixed cost (an order “handling fee” that our supplier charges) plus a variable shipping cost based on the shipping method name in Shopify. When mapping line items like I am now, I can’t add these additional items because the array aggregator doesn’t give me options to add additional line items.

Here’s an example of the previous set up in the Xero module where the first line item is the product itself…

And the second line item is the fixed rate “handling fee”. The shipping cost would follow as a third line item.

And here’s the array aggregator in the current setup… there’s no way to add the “handling fee” line item and the shipping cost. Any idea how I can add these additional costs?

I haven’t read all the details, to fix this what you can do is change the Source Module of your current aggregator from Get an Item o Xero Module to Iterator.

Screenshot from 2023-06-30 12-54-48

Thanks Runcorn, this fixed the issue!