Can't get a max() value out of array

Hey Guys!
I don’t know what I am doing wrong. I have a json repsonse object which looks like that:

[ {SalesOrder: 1000, SalesOrderItem: 1 }, {SalesOrder: 1000, SalesOrderItem: 2}, {SalesOrder: 1001, SalesOrderItem: 1} ]

I would like to the the highest number of the SalesOrderItem in the SalesOrder 1000.

My formula looks like that:
MAX(PLUCK(SELECT(data.SalesOrderItems, item.SalesOrder == "1000") ,"SalesOrderItem")))

Could you help me to figure out why I am not getting the result?

Hi Markus,

I noticed your formula has an extra “)” at the end. Otherwise it seems to be working? :slight_smile:

1 Like

Hey Akseli,

Thank you for your reply. It wasn’t a formula issue. I configured the headers of my API request wrong :roll_eyes: