Get List Item
Get List Item
Section titled “Get List Item”Type: list-get · Package: Collections Activities v1.0.3 · Output: object
Gets the element at a specific position of the list. Indexes start at 0: the first element is index 0, the second 1, etc.
How it works
Section titled “How it works”Reads the element at position index of list and returns it. It does not modify the list. If the index does not exist, it fails with a message stating how many elements the list has.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
list | List | — | The list. |
index | int | — | Position, counting from 0. It must be between 0 and the number of elements minus 1. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”Returns an object with the element, with its original type. If the stored element is null, it returns null.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Index … is out of range (list count: …). | The index is negative or greater than or equal to the size (also for an empty list). Check the size with List Count. |
'list' must be a List, got …. | list is not a list (the message shows the type received, or null). |
| .NET format error | index is a text that is not an integer. |
Example
Section titled “Example”Get List Item list = names index = 0 → output: firstLog message = "First name: " + firstRelated activities
Section titled “Related activities”- List Count — know how many elements there are.
- Add to List — add elements.