# Copy rows

Copy a row's displayed columns as tab-separated text. Spreadsheet apps paste each column into a separate cell, making it useful for transferring several values from one order.

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

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

## How it works and when to use it

copyRowAt accepts the current display position. If your app selects rows by business ID, locate that ID in the displayed view before copying.

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 current first row

Connect row copying to a user button click.

```javascript
console.log(await grid.copyRowAt(0));
```

Verify the result: Displayed column values are copied as TSV. Hidden columns are excluded from copying based on displayed columns.

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

## Example 2. Copy from a compact view

Hide the unit price column, then copy the same row.

```javascript
await grid.hideColumn('price');
// Call from the user's Copy button
console.log(await grid.copyRowAt(0));
```

Verify the result: Paste into a spreadsheet to compare the order and count of the displayed columns.

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

## Example 3. Compare with copying multiple rows

To transfer multiple orders, choose range copying or CSV export instead of repeatedly copying individual rows.

Verify the result: Offer clear choices for transferring a single row once and transferring a batch through a file.

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

## Combining features and troubleshooting

Tabs, line breaks, and formula-like text inside cells may be interpreted differently by the receiving app. Verify behavior in the actual destination app.

A selection checkbox does not make copyRowAt automatically target the selected row. Explicitly pass the displayed row position.

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

## APIs used by this feature

- [copyRowAt](https://grid.syidax.com/docs/methods/copyRowAt.md) — Copies a displayed row 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/row-copy) — The guide describes which interactions are available to try.
