PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

Get Element

Returns the element at a given position (index, starting from 0) in a list.

The Get Element action returns the element found at a given position in a list. Positions start at 0: the first element is at index 0, the second at 1, and so on.

Add the action

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

The Get Element action properties: Input a list, Input the index of the element and Result

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
Input a listInputList of any typeYesThe list to read from, for example [10,20,30].
Input the index of the elementInputIntegerYesThe position of the element, starting from zero.
ResultOutputSame type as the list elementsYesThe element at that position. For a list of data models, map a variable of that data model.

Example

Input a listInput the index of the elementResult
[10,20,30]010
["a","b","c"]2c
[{"id":1,"name":"Ann"},{"id":2,"name":"Bob"}]1{"id":2,"name":"Bob"}
["a","b","c"]3The step fails: Index exceeds the list's size.
[]0The step fails: Index exceeds the list's size.
["a","b","c"]-1The step fails (negative indexes are not allowed; -1 does not mean "last element").

Good to know

  • Indexes are zero-based. To get the last element, compute length โˆ’ 1 with Length and Subtract, or use Last N Elements with 1.
  • An index equal to or greater than the list length, or any index on an empty list, makes the step fail.

On this page