PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

Get Index

Finds a value or object in a list and returns its position (starting from 0), or -1 if it is not found.

The Get Index action searches a list for a value and returns its position. Positions start at 0 (the first element is at index 0). If the value is not in the list, the result is -1. Use the result with Get Element or Sublist.

Add the action

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

The Get Index action properties: Input list, Input object to be found and Result

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
Input listInputList of any typeYesThe list to search.
Input object to be foundInputAny value (text, number, Boolean, Object (JSON), data model)YesThe value to look for.
ResultOutputIntegerYesThe zero-based position of the first match, or -1 if there is no match.

Example

Input listInput object to be foundResult
["a","b","c","b"]b1 (first occurrence)
[10,20,30]302
["a","b"]z-1
["a","B"]b-1 (case-sensitive)
[{"id":1},{"id":2}]{"id":2}1

Good to know

  • Indexes are zero-based: the first element is 0, the last is length โˆ’ 1.
  • With duplicates, you get the index of the first one.
  • Matching works like Contains: text is case-sensitive, a number matches the same number as text, and objects must match on all properties (in any order).
  • An empty Input object to be found makes the step fail with Input was null. Please, fill it.

On this page