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

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