# rowIdFromKey (@salmonui/data-grid/engine)

> The rowIdFromKey function of @salmonui/data-grid/engine: Builds a getRowId from a primary key: a field name, several field names (joined with \u001f), or a function. The React DataGrid uses it for primaryKey columns.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine/rowIdFromKey

```ts
import { rowIdFromKey } from '@salmonui/data-grid/engine';
```

Entry index: https://salmonui.dev/docs/reference/data-grid/engine (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine.md).

## Reference

Kind: function

```ts
function rowIdFromKey<Row>(key: string | readonly string[] | ((row: Row) => RowId | number)): (row: Row) => RowId;
```

Builds a `getRowId` from a primary key: a field name, several field names
(joined with `\u001f`), or a function. The React `DataGrid` uses it for `primaryKey` columns.
