---
title: "Say what select all selects · Agent Wranglers"
url: https://agentwranglers.se/playbook/app-ui/lists-and-tables/bulk-selection
updated: 2026-10-20
licence: "All rights reserved"
---

# Say what select all selects

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Lists and tables](https://agentwranglers.se/playbook/app-ui/lists-and-tables)
- Rule: When people select all rows, say whether that means this page or every matching record, and show the count before any bulk action.
- How: The header checkbox selects the visible page. Then offer a link to select every match, such as "Select all 2,340 orders". For every match, send the filter to the server, not a list of IDs. The server applies the filter again with the user's permissions. Name the count on the action button, such as "Archive 2,340 orders".
- Check: A browser test selects all on a filtered list of 120 records with 50 per page, then picks every match. The button says 120, and the server archives exactly those 120.

Example:

```ts
type Selection = { kind: 'ids'; ids: string[] } | { kind: 'matching'; filters: OrderFilters; count: number };

export const archiveLabel = (selection: Selection) =>
  `Archive ${selection.kind === 'ids' ? selection.ids.length : selection.count} orders`;
```

```python
@app.post("/api/orders/archive")
def archive_orders():
    body = request.json
    if body["kind"] == "matching":
        query = order_query_for(current_user(), OrderFilters(**body["filters"]))
    else:
        query = order_query_for(current_user()).where(Order.id.in_(body["ids"]))
    return {"archived": orders.archive(query)}
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers app interface playbook: https://agentwranglers.se/playbook/app-ui/lists-and-tables/bulk-selection`.

- Previous: [Key rows by their ID](https://agentwranglers.se/playbook/app-ui/lists-and-tables/stable-row-keys)
- [Lists and tables](https://agentwranglers.se/playbook/app-ui/lists-and-tables)
