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

# 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 }
```
