# Copy cells

Copy one cell's display text to the system clipboard. Selected text inside a cell editor and a focused Grid cell are different copy targets.

Canonical: https://grid.syidax.com/docs/features/single-cell-copy/

<a id="understand"></a>

## How it works and when to use it

Clipboard access depends on the browser environment and user activation. Request copying from a button click or keyboard action and check the return value.

In the code, grid is the Grid element prepared in the installation chapter. Check each example's data and settings, and implement the app functions and server endpoints for your project.

- [Installation and integration · Shared sample data](https://grid.syidax.com/docs/guides/getting-started.md)

<a id="example-1"></a>

## Example 1. Copy the first displayed product

Connect the following call to the user's Copy button click.

```javascript
const copied = await grid.copyCellAt(0, 'product');
console.log(copied);
```

Verify the result: true indicates successful copying. If the table has been sorted, the target is the product in the current first displayed row.

<a id="example-2"></a>

## Example 2. Copy calculated or formatted cells

Apply currency formatting to an amount, then inspect the copied text. Do not assume the copied value equals the original number.

Verify the result: Paste into the target input to verify the intended representation. For machine-readable numbers, reading the source data API may be more appropriate.

<a id="example-3"></a>

## Example 3. Permissions and failure handling

Try copying both restricted and regular cells, and display appropriate guidance for rejected operations.

```javascript
grid.clipboardEscapeFormulae = true;
```

Verify the result: Also review protection settings for strings that spreadsheet apps may interpret as formulas. Distinguish this protection from changing the meaning of business values.

<a id="pitfalls"></a>

## Combining features and troubleshooting

Browsers may reject clipboard requests from asynchronous timers unrelated to user activation. Do not report clipboard permission failures as Grid data errors.

If source values are restricted, tooltips, copying, and export must follow the same access policy. Merely removing visible text is insufficient.

<a id="related-api"></a>

## APIs used by this feature

- [clipboardEscapeFormulae](https://grid.syidax.com/docs/options/clipboardEscapeFormulae.md) — Escapes spreadsheet formula prefixes in outgoing clipboard text.
- [copyCellAt](https://grid.syidax.com/docs/methods/copyCellAt.md) — Copies the value at a displayed row and field and returns success.

<a id="next"></a>

## Related reading

- [How rows, columns, and IDs relate](https://grid.syidax.com/docs/guides/concepts.md)
- [Connect results and events](https://grid.syidax.com/docs/guides/data-event-access.md)
- [Explore in Features](https://grid.syidax.com/grid/single-cell-copy) — The guide describes which interactions are available to try.
