---
title: "struct_contains function in Strata | Oplema"
description: "Check whether an unnamed struct contains a given value, returning true or false. For example, struct_contains(row(1, 2, 3), 2) returns true."
url: "https://oplema.com/docs/strata/functions/struct-contains"
updated: "2026-11-04"
---

# struct\_contains

Check whether an unnamed struct contains a value.

Also available as struct\_has.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **BOOLEAN**.

### Expression

```
struct_contains(row(1, 2, 3), 2)
```

### Result

```
true
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

This Boolean expression also works in [Filter](https://oplema.com/docs/strata/prep/filter) custom mode. For the literal inputs above, the row goes to the True output. A missing result goes to False.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | true |

## Arguments and types

```
struct_contains(struct, entry)
```

**struct**

Struct

**entry**

Any value

Supported signatures (1)

```
struct_contains(struct: STRUCT, 'entry': ANY) → BOOLEAN
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[row

Create an unnamed struct from its arguments.

](https://oplema.com/docs/strata/functions/row)[struct\_insert

Add fields to an existing struct. Each new field takes its name from a named argument, as in struct\_insert(s, b := 2).

](https://oplema.com/docs/strata/functions/struct-insert)[struct\_position

Find the position of a value in an unnamed struct, starting at 1.

](https://oplema.com/docs/strata/functions/struct-position)[struct\_update

Change or add fields in an existing struct. Each field takes its name from a named argument, as in struct\_update(s, b := 2).

](https://oplema.com/docs/strata/functions/struct-update)

[Browse structs](https://oplema.com/docs/strata/functions#structs) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/struct.html#struct_containsstruct-entry)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
