---
schema_version: "1"
id: 375ef05c29becb7f550e54f77fc915794ecfced369a950b20e0f41029964b2d3
title: Tableau JavaScript API Concepts--Collections
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/api/js_api/JavaScriptAPI/js_api_concepts_collections.md
canonical_url: https://help.tableau.com/current/api/js_api/en-us/JavaScriptAPI/js_api_concepts_collections.htm
source_site: help.tableau.com
content_type: documentation
content_hash: a0ba349d6d6713e89cb157034ac46988adaff541a65e0305ca1646657fcf43d7
description: Important changes for the Tableau JavaScript API
---
[Skip to main content](#main-content)

# Collections

**Important changes for the Tableau JavaScript API**

As of February 2024, the Tableau JavaScript API is deprecated. Use the Embedding API v3 instead for embedding interactive views into web pages and applications. For guidance on embedding Tableau views, see the [Tableau Embedding API v3 Help](https://help.tableau.com/current/api/embedding_api/en-us/index.html).

Many classes have collections of items, where each item has a key (typically an ID or a name). Examples include a collection of sheets keyed by name or the list of parameters on a sheet keyed by name. Collections are publicly immutable, exposing read-only functionality. Each Collection array is keyed with its elements' identifiers. For example, the result of `Workbook.getPublishedSheetsInfo()` is an array with the index corresponding to the position of the sheet in the workbook.

```
var sheet = workbook.getPublishedSheetsInfo()[0];
```

It is also keyed by the sheet name so that you can access it like this:

```
var sameSheet = workbook.getPublishedSheetsInfo().get("Sheet 1");
```

## Collection Interface

<table class="table--plain">
                    <thead>
                        <tr class="TableStyle-TopNav-Head-Header1">
                            <th width="36%" valign="top" class="TableStyle-TopNav-HeadE-Column1-Header1">
                                <p class="MsoNormal"><b>Name</b>
                                </p>
                            </th>
                            <th width="13%" valign="top" class="TableStyle-TopNav-HeadE-Column1-Header1"><b>Return Type</b>
                            </th>
                            <th width="49%" valign="top" class="TableStyle-TopNav-HeadD-Column1-Header1"><b>Description</b>
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="TableStyle-TopNav-Body-Body1">
                            <td width="36%" valign="top" class="TableStyle-TopNav-BodyE-Column1-Body1">
                                <p class="MsoNormal"><b>get(key : string)</b>
                                </p>
                            </td>
                            <td width="13%" valign="top" class="TableStyle-TopNav-BodyE-Column1-Body1">
                                <p class="MsoNormal">Collection item type</p>
                            </td>
                            <td width="49%" valign="top" class="TableStyle-TopNav-BodyD-Column1-Body1">
                                <p class="MsoNormal">Gets the element in the collection associated with the key, or undefined if there is nothing associated with it.</p>
                            </td>
                        </tr>
                        <tr class="TableStyle-TopNav-Body-Body1">
                            <td width="36%" valign="top" class="TableStyle-TopNav-BodyB-Column1-Body1">
                                <p class="MsoNormal"><b>has(key : string)</b>
                                </p>
                            </td>
                            <td width="13%" valign="top" class="TableStyle-TopNav-BodyB-Column1-Body1">
                                <p class="MsoNormal">bool</p>
                            </td>
                            <td width="49%" valign="top" class="TableStyle-TopNav-BodyA-Column1-Body1">
                                <p class="MsoNormal">Returns true if there is an element in the collection associated with the key; otherwise, false.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>