findColumn() function

The findColumn() function returns an array of values in a specified column from the first table in a stream of tables where the group key values match the specified predicate. The function returns an empty array if no table is found or if the column label is not present in the set of columns.

    fn: (key) => key._field == "fieldName",
    column: "_value",



A predicate function for matching keys in a table’s group key. Expects a key argument that represents a group key in the input stream.


Name of the column to extract.


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


The following example uses data provided by the sampledata package to show how findColumn() transforms data.

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

Was this page helpful?

Thank you for your feedback!

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.