Unable to Retrieve Last Object In Array (Last Tracking Number Used)

Hello,
I am so close to getting this scenario to do exactly what I need it to do, hoping for some help to get me the rest of the way. Thanks in advance for any insight!

I am using Make to pull tracking numbers from Shopify orders and update the tracking number for the corresponding order in Airtable. I can successfully do this, but only grabbing the first tracking number in an array. I’d like to grab the last tracking number used, because sometimes we have to cancel a tracking number and re-fulfill the item with a new tracking number. When this happens, each tracking number is within a collection, within an array. Screenshots below:

Blueprint

Shopify Output

This is a test order in which the tracking number was updated 9 times.

It’s grabbing this one in Collection 1

I want it to grab whatever is the last tracking number used, in this case, in collection 9.

This is the mapping I am using:

Using the Last () function, I have tried many variations of the path to the tracking, including the below, but nothing has worked so far.

{{1.data.fulfillments.1.tracking_numbers.1}} - works to get 1st in series

{{1.data.fulfillments.tracking_number.}}

{{1.data.fulfillments.tracking_number}}

What am I missing? Thanks for any help!

Cheers,
Laura

Hey Laura,

are you trying to access the nested array directly? Or are you processing the items in the first array one by one?

To get the last tracking number you need to call last() on the tracking_numbers array, but the rest of the function will depend entirely on what you are doing with the fulfillments array and what your entire flow is.

Hi Stoyan,
Thanks for replying! I think the issue I am running into is that the path goes Data (collection) > fulfillments (array) > collection 1, 2, 3…
Screenshot 2024-09-30 at 11.13.02 AM

So, with a single order, if the tracking number is updated multiple times, it creates a new collection. I was hoping to find a way to have Make find the last tracking number in the last collection, so it would always be returning the most current one.

Even if I use tracking numbers (array) instead of tracking number, there is just one entry in that array to choose from anyway.

Thanks!