---
keyword: [Extend, PMD Scripting, Scripts, Graph API]
nav: wcp_docs
parent_url: /wcp_docs/
title: createId(ids)
layout: subsection
---

## <a id="section_1"></a>Description

Returns an instance ID object for Graph API mutations with the first `id` in the specified list of IDs. The default identifier type is "WID".

Returns null if the `ids` list is null or empty.

## <a id="section_2"></a>Return Type

`Map`

## <a id="section_3"></a>Namespace Function Syntax

```
graph:createId(id, idType)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>ids</td><td>List of strings. A list of IDs. The first ID in the list is used as the ID of the Graph API instance ID object.</td></tr></tbody></table><br/>

<b>Examples</b>

`graph:createId(['ID1', 'ID2'])`

Returns

```
{
  "id": {
    "id": "ID1",
    "type": "WID"
  }
}
```

`graph:createId(null)`

Returns `null`.

`graph:createId([])`

Returns `null`.

### Related Information

[Example: graph Namespace Functions](/wcp_docs/GUID-1dc1fd91-da7b-419f-9efd-6ba1243a1e36-enHYPHENus.html)

