---
schema_version: "1"
id: 875e60c5d12bddc955ae0cd4bf0e76a310eca8c04880a133ff682bc3c3c5e913
title: isEmpty
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.4/dw-core-functions-isempty.md
canonical_url: https://docs.mulesoft.com/dataweave/2.4/dw-core-functions-isempty
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 9e6630632759fa4c44c206428af189b032786fc743a6967f8650623e47f86e7d
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
---
product: DataWeave
version: 2.4
---

# isEmpty

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## isEmpty(elements: Array<Any>): Boolean

Returns `true` if the given input value is empty, `false` if not.

This version of `isEmpty` acts on an array. Other versions act on a string or object, and handle
null values.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>elements</code></p></td><td><p>The input array to evaluate.</p></td></tr></tbody></table>

### Example

This example indicates whether the input array is empty.

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ isEmpty([]), isEmpty([1]) ]
```

#### Output

```JSON
[ true, false ]
```

## isEmpty(value: String): Boolean

Returns `true` if the input string is empty, `false` if not.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>value</code></p></td><td><p>A string to evaluate.</p></td></tr></tbody></table>

### Example

This example indicates whether the input strings are empty.

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ isEmpty(""), isEmpty("DataWeave") ]
```

#### Output

```JSON
[ true, false ]
```

## isEmpty(value: Object): Boolean

Returns `true` if the given object is empty, `false` if not.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>value</code></p></td><td><p>The object to evaluate.</p></td></tr></tbody></table>

### Example

This example indicates whether the input objects are empty.

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ isEmpty({}), isEmpty({name: "DataWeave"}) ]
```

#### Output

```JSON
[ true, false ]
```

## isEmpty(value: Null): true

Returns `true` if the input is `null`.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>value</code></p></td><td><p><code>null</code> is the value in this case.</p></td></tr></tbody></table>

### Example

This example indicates whether the input is `null`.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ "nullValue" : isEmpty(null) }
```

#### Output

```JSON
{ "nullValue": true }
```
