API apply groupby

hi all,

I’m trying to fetch data via the API: I need the most recent date time per carrier number.
So I’m using something like $apply=groupby((carrierNo),aggregate(systemcreatedat with max as MostRecentAction))

But I’ve got the impression the ‘apply’ is simply ignored by the API.

Anyone any experience with getting apply/groupby/aggregate to work?

1 Like

@KristenHosman - where’s mary myers when you need her?

1 Like

I just sent her a message with link. Hopefully she can help!

1 Like

I’m not a developer,but have dealt with this in Power Automate, and it is tricky. I pinged Stefan Maron who is my go to API Guru, and this was his response
“I did not find any docs saying that this is supported. I never tried it myself. But it is possible to create a “query” in bc and expose it as API. Queries support grouping out of the boxc. But then the API will always be grouped”

2 Likes

Thank you all for your quick answers! Really appreciate this!
Unfortunatelly I don’t have access to the BC development environment, so while creating and exposing a query is most likely the solution, I’m not able to do this :-(.
I ended up grouping a bunch of inquiries (making use of orderby and top=1) in one batch request. Not the most optimal solution performance-wise, but it is working and fast enough at the moment.