---
schema_version: "1"
id: 86a1c6198b76e5f11e325225744614949a488d698a7d56fc1e120dd6a0701f99
title: isUnionType
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.12/dw-types-functions-isuniontype.md
canonical_url: https://docs.mulesoft.com/dataweave/2.12/dw-types-functions-isuniontype
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7742e4d0bb93c1c67484e4f75b4cbfdc8b44cb78368a38fdcfbddc7b1a730e11
description: MuleSoft Documentation Site
release: "2.12"
latest: false
---
---
product: DataWeave
version: 2.12
---

# isUnionType

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

## isUnionType(t: Type): Boolean

Returns `true` if the input type is the Union type.

_Introduced in DataWeave version 2.3.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>t</code></p></td><td><p>The type to check.</p></td></tr></tbody></table>

### Example

This example shows how `isUnionType` behaves with different inputs.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Types
type AType = String | Number
output application/json
---
{
   a: isUnionType(AType),
   b: isUnionType(Boolean),
}
```

#### Output

```Json
{
  "a": true,
  "b": false
}
```
