OSDK "group by field" utility function

Hi, I have an app built on the OSDK. I want to return object set items grouped by a field. For example, they have a field called group, is there an osdk utility function so that I can get

"data": [
        {
            "group": "group1",
            "items": [
                {
                    "id": "uuid-1234-5678-kjlk-nown",
                    "field1": "field1Value",
                    "field2": "field2Value",
                    "field3": "field3Value"
               }]
         },
        {
            "group": "group2",
            "items": [
                {
                    "id": "uuid-1234-5678-kjlk-abcd",
                    "field1": "field1Value",
                    "field2": "field2Value",
                    "field3": "field3Value"
               }]
         }

I am not trying to sum or count, just trying to group the items :slight_smile:

You are selecting all the data and want to collect it by group?
if you get all the data and use orderBy group you could use data.map( to build whatever structure you need?

1 Like