PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

Sublist

Extracts part of a list, starting at a given index and spanning a given number of elements.

The Sublist action copies a slice of a list: it starts at a given position and takes a given number of elements. Use it to process a list in pages or batches (for example elements 0โ€“99, then 100โ€“199).

Add the action

In the Process Designer toolbox, open List and pick Sublist (or type Sublist in the search box).

The Sublist action properties: Input a list, Starting Index, Length and Result Sublist

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
Input a listInputList of any typeYesThe list from which a sublist will be extracted.
Starting IndexInputIntegerYesZero-based index of the first element to include (0 = first element).
LengthInputIntegerYesThe number of elements to include.
Result SublistOutputList (same type as the input)NoThe extracted elements.

Example

Input a listStarting IndexLengthResult Sublist
["a","b","c","d","e"]13["b","c","d"]
["a","b","c","d","e"]310["d","e"] (stops at the end of the list)
["a","b"]00[]
[{"id":1},{"id":2},{"id":3}]02[{"id":1},{"id":2}]
["a","b"]21The step fails: Index exceeds the list's size.
[]01The step fails: Input was null or empty.
["a","b"]-1 or length -1The step fails: An error occured while extracting the sublist.

Good to know

  • A Length larger than what is left is allowed: you get the elements up to the end of the list.
  • Starting Index must point to an existing element (from 0 to length โˆ’ 1). Negative values are not allowed.
  • An empty list makes the step fail.
  • The input list is not changed.

On this page