---
keyword: [Extend, PMD Scripting, Scripts, Graph API]
nav: wcp_docs
parent_url: /wcp_docs/
title: createId(ids, idType)
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 and the specified `idType`.

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(ids, 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><tr><td>idType</td><td>List of strings. The type of the Graph API instance ID object.</td></tr></tbody></table><br/>

<b>Examples</b>

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

Returns

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

`graph:createId(null, 'ID_TYPE')`

Returns `null`.

`graph:createId([], 'ID_TYPE')`

Returns `null`.

