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

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