---
title: getColumn() function
description: getColumn() extracts a specified column from a table as an array.
url: https://docs.influxdata.com/flux/v0/stdlib/universe/getcolumn/
estimated_tokens: 1357
product: Flux
version: v0
---

# getColumn() function

-   Flux 0.29.0+
-   View InfluxDB support

`getColumn()` extracts a specified column from a table as an array.

If the specified column is not present in the table, the function returns an error.

##### Function type signature

```js
(<-table: stream[A], column: string) => [B] where A: Record
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### column

(Required) Column to extract.

### table

Input table. Default is piped-forward data (`<-`).

## Examples

-   [Extract an array of column values from a table](#extract-an-array-of-column-values-from-a-table)
-   [Extract an array of column values and display them in a table](#extract-an-array-of-column-values-and-display-them-in-a-table)

### Extract an array of column values from a table

```js
import "sampledata"

sampledata.int()
    |> tableFind(fn: (key) => key.tag == "t1")
    |> getColumn(column: "_value")// Returns [-2, 10, 7, 17, 15, 4]

```

### Extract an array of column values and display them in a table

```js
import "array"
import "sampledata"

columnData =
    sampledata.int()
        |> tableFind(fn: (key) => key.tag == "t1")
        |> getColumn(column: "_value")

array.from(rows: [{_value: display(v: columnData)}])
```

#### Related

-   [Extract scalar values in Flux](/influxdb/v2/query-data/flux/scalar-values/)

[dynamic queries](/flux/v0/tags/dynamic-queries/)
