---
schema_version: "1"
id: e0834688e7f1e27581fff917b74122efe3a86c4a159d455a883cefa278d28066
title: nameSet
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.9/dw-objects-functions-nameset.md
canonical_url: https://docs.mulesoft.com/dataweave/2.9/dw-objects-functions-nameset
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6f67044e696134e7fa1bea4df654f23da484732cbc7562633b7fd66ca6bcfc03
description: MuleSoft Documentation Site
release: "2.9"
latest: false
---
---
product: DataWeave
version: 2.9
---

# nameSet

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

## nameSet(obj: Object): Array<String>

Returns an array of keys from an object.

_This function is **Deprecated**. Use [dw::Core::namesOf](https://docs.mulesoft.com/dataweave/2.9/dw-core-functions-namesof), instead._

### Parameters

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

### Example

This example returns the keys from the input object.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Objects
output application/json
---
{ "nameSet" : nameSet({ "a" : true, "b" : 1}) }
```

#### Output

```JSON
{ "nameSet" : ["a","b"] }
```
