---
title: "Select columns by name"
method: POST
path: "/dataset/{handle}/select-columns/by-name"
tags: ["data"]
---

# Select columns by name

`POST /dataset/{handle}/select-columns/by-name`

Makes the file have only the provided columns, in the specified order. Deletes all other columns. Always keeps the row number column.

## Path parameters

- `handle` string, required

## Request body

- FilesSelectColumnsRequest
  - `column_names` string[] — Columns to select, in the order they should be in the file. The leftmost column will always be the row number column, even if not included here.
  - `delete_all_others` boolean — If true, deletes all columns not included in column_names. If false, keeps all columns but moves the selected columns to be leftmost in the order provided. Defaults to false.

## Response `200`

OK

- unknown

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error

---

[API](https://skmtc.net/freshdesk/apis/gigasheet-api.md) · [All operations](https://skmtc.net/freshdesk/apis/gigasheet-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/freshdesk/gigasheet-api/revisions/d1e5cbb24557/schema)
