---
title: Utility functions
slug: analytics/docs/utility-functions
docTags: 
createdAt: 2026-07-20T15:44:35.706Z
---

Outlines the utility functions that are available in NetScript.

## to\_string(input)

Use this function to convert any input value to a string.

**Function**

```auto
to_string(input)
```

**Data type** – string

**Example**

```auto
to_string(5)
```

**Result**

```auto
"5"
```

## to\_int(input)

Use this function to convert any input value to an integer.

**Function**

```auto
to_int(input)
```

**Data type** – string

**Example**

```auto
to_int(10.1) 
to_int('10') 
```

**Result**

```auto
"10"
"10"
```

## to\_boolean(input)

Use this function to convert any input value to a boolean.

**Function**

```auto
to_boolean(input)
```

**Data type** – boolean

**Example**

```auto
to_boolean('true') 
```

**Result**

```auto
"true"
```

## to\_float(input)

Use this function to convert any input value to a float.

**Function**

```auto
to_float(input)
```

**Data type** – float

**Example**

```auto
to_float('10.5') 
```

**Result**

```auto
10.5
```

## to\_timestamp(input)

Use this function to convert any input value to a timestamp.

**Function**

```auto
to_timestamp(input)
```

**Data type** – timestamp

**Example**

```auto
to_timestamp(dateColumn) 
```

**Result**

```auto
"2024-01-01 08:00:00"
```

## coalesce

Use this function to return the first non-null value in a list of two or more arguments.

**Function**

```auto
coalesce
```

**Example**

```auto
coalesce(null, 1)
```

**Result**

```auto
1
```
