---
title: "uuidv4 function in Strata | Oplema"
description: "Return a random UUID v4 for each row, such as 7e7ea35f-f813-46ce-ac7b-12658c021bcb. Same as uuid. Write it as uuidv4() in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/uuidv4"
updated: "2026-11-04"
---

# uuidv4

Return a random UUID v4, such as 7e7ea35f-f813-46ce-ac7b-12658c021bcb.

## Try an expression

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

### Expression

```
uuidv4()
```

### Expected behavior

```
A newly generated version 4 UUID.
```

The expression returns `UUID`. Formula stores it as `VARCHAR` in this example. Its value varies between executions; the example checks its behavior rather than a fixed value.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 8c23499f-eb97-4472-b82c-c6a827d48c02 |

## Arguments and types

```
uuidv4()
```

Supported signatures (1)

```
uuidv4() → UUID
```

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

## Related functions

[gen\_random\_uuid

Return a random UUID v4, such as 7e7ea35f-f813-46ce-ac7b-12658c021bcb.

](https://oplema.com/docs/strata/functions/gen-random-uuid)[uuid

Return a random UUID v4, such as 7e7ea35f-f813-46ce-ac7b-12658c021bcb.

](https://oplema.com/docs/strata/functions/uuid)[uuidv7

Return a random, time-ordered UUID v7, such as 019482e4-1441-7aad-8127-eec99573b0a0.

](https://oplema.com/docs/strata/functions/uuidv7)[typeof

Return the name of an expression's data type.

](https://oplema.com/docs/strata/functions/typeof)

[Browse conversion & identifiers](https://oplema.com/docs/strata/functions#conversion-&-identifiers) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/utility.html#uuidv4)

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