---
title: tableFind() function
description: tableFind() extracts the first table in a stream with group key values that match a specified predicate.
url: https://docs.influxdata.com/flux/v0/stdlib/universe/tablefind/
estimated_tokens: 279
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/universe/tablefind/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.29.0+

InfluxDB support

`tableFind()` extracts the first table in a stream with group key values that
match a specified predicate.

##### Function type signature

```js
(<-tables: stream[B], fn: (key: A) => bool) => stream[B] where A: Record, B: Record
```

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

## Parameters

### fn

(Required)
Predicate function to evaluate input table group keys.

`tableFind()` returns the first table that resolves as `true`.
The predicate function requires a `key` argument that represents each input
table’s group key as a record.

### tables

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

## Examples

### Extract a table from a stream of tables

```
import "sampledata"

t =
    sampledata.int()
        |> tableFind(
            fn: (key) => key.tag == "t2",
        )// t represents the first table in a stream whose group key
// contains "tag" with a value of "t2".

```

#### Related

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

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