---
schema_version: "1"
id: e8dc0c8f3bd3057f7267f73e87210301b12b9e669974df46430cc834f294b4d1
title: nameOf
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.4/dw-types-functions-nameof.md
canonical_url: https://docs.mulesoft.com/dataweave/2.4/dw-types-functions-nameof
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 04f148765bb5048d9e46d36f9ec15ac3dba379e17c56e7fb938c9a890729d2a0
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
---
product: DataWeave
version: 2.4
---

# nameOf

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

## nameOf(t: Type): String

Returns the name of the input 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 query</p></td></tr></tbody></table>

### Example

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

#### Source

```DataWeave
%dw 2.0
output application/json
import * from dw::core::Types
type AArray = Array<String> {n: 1}
type AArray2 = Array<String>
---
 {
     a: nameOf(AArray),
     b: nameOf(AArray2),
     c: nameOf(String)
 }
```

#### Output

```Json
{
   "a": "AArray",
   "b": "AArray2",
   "c": "String"
 }
```
