How to pull a variable value from an array?

Hello! I have a scenario that pulls shipping cost from orders in shipstation, and also pulls how much the customer paid for my shipping manager to keep an eye on the expense. We have several different shipping methods that come through with different SKU’s, but there is only ever one shipping line per order, and a set list of SKU’s that represent the shipping method.

My issue is: how do i reliably grab the shipping line item from the list of order items, so that way i can grab the cost from the same collection in the array? I used the map function to accurately grab it in testing, but thats only good for if im targeting a single, specific SKU. My intent is once I identify the shipping line item collection, to extract the item unit price associated with it to put on a google sheet.

Sorry if this is a simple function, I’m just struggling to figure out the best way to do it!

image

Nevermind, this worked for me. All of my shipping SKUs start with SS so i was able to filter like Bjorn suggested!

2 Likes

Heya @Grant_Rogers welcome to the Make Community :wave:

It’s great to hear that Bjorn’s advice previously shared in the community helped you get this up and running. Thanks for keeping us updated on your progress! :muscle:

1 Like