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

# 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.4/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"] }
```
