---
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: subList (fromIndex, toIndex)
layout: subsection
---

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

Returns the portion of the list between the specified fromIndex (inclusive) and toIndex (exclusive).

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

`List`

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

```
thisList.subList(fromIndex, toIndex)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>fromIndex</td><td>The 0-based starting index (inclusive).</td></tr><tr><td>toIndex</td><td>The ending index (exclusive). Specify the 0-based ending position plus 1.</td></tr></tbody></table><br/>

<b>Example</b>

`[0, 1, 2, 3].subList(1, 3)`

Returns `[1,2]`

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

`list:subList(list, fromIndex, toIndex)`

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>list</td><td>The input List.</td></tr><tr><td>fromIndex</td><td>The starting index position (inclusive).</td></tr><tr><td>toIndex</td><td>The ending index position (exclusive).</td></tr></tbody></table><br/>

