---
title: "Count a table's records per value, as the builder"
description: "How many rows sit under each value of one column, ordered the way that column sorts."
canonical: "https://grid82.com/docs/builder-api/data/records-groups"
updated: "2026-11-13"
---

# Count a table's records per value, as the builder

`GET https://studio.grid82.app/v1/apps/{appId}/tables/{tableId}/records/groups`

How many rows sit under each value of one column, ordered the way that column sorts.

`fieldId` takes the field's id or exact name; an unknown one is refused, listing the table's fields.

Requires the `records:read` scope. Operation `apps.records.groups`. MCP tool `apps_records_groups`. CLI: `grid82 apps records groups` (`npx grid82`).

## Path parameters

| Name      | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `appId`   | string | yes      |             |
| `tableId` | string | yes      |             |

## Query parameters

| Name      | Type    | Required | Description            |
| --------- | ------- | -------- | ---------------------- |
| `viewId`  | string  | no       | Up to 64 characters.   |
| `search`  | string  | no       | Up to 200 characters.  |
| `filter`  | string  | no       | Up to 4000 characters. |
| `sorts`   | string  | no       | Up to 1000 characters. |
| `where`   | string  | no       | Up to 4000 characters. |
| `fieldId` | string  | yes      | Up to 200 characters.  |
| `limit`   | integer | no       |                        |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**200**: Success

- `data` (`object`, required)
- `data.groups` (`object[]`, required)
- `data.groups.key` (`object`, required)
- `data.groups.count` (`number`, required)
- `data.truncated` (`boolean`, required)

```json
{
  "data": {
    "groups": [
      {
        "key": null,
        "count": 123.45
      }
    ],
    "truncated": true
  }
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request GET \
  --url 'https://studio.grid82.app/v1/apps/<appId>/tables/<tableId>/records/groups?fieldId=<fieldId>' \
  --header 'Authorization: Bearer <token>'
```
