---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: addAll (elements)
layout: subsection
---

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

Adds all elements in the specified collection to the set, if they're not already present. If an element already exists in the set, this functon doesn't replace the existing element.

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

`Set`

## <a id="section_dz5_pwg_5db"></a>Instance Method Syntax

```
thisSet.addAll(elements)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>elements</td><td>The collection of elements to add.</td></tr></tbody></table><br/>

<b>Example</b>

`{1, 2}.addAll({3})`

Returns `{1, 2, 3}`.

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

```
set:addAll(set, elements)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>set</td><td>The input Set.</td></tr><tr><td>elements</td><td>The collection of elements to add.</td></tr></tbody></table><br/>

