# Collection

## All

Takes a list of objects and returns TRUE if each objects meets the specified condition.

#### Syntax <a href="#pragma-line-3118" id="pragma-line-3118"></a>

```
All ( Objects , ObjectName , Condition )
```

#### Parameters <a href="#pragma-line-3124" id="pragma-line-3124"></a>

***Objects***\
&#x20;List of objects which will be evaluated.\
&#x20;Type: List\<Any>

***ObjectName***\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition***\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3139" id="pragma-line-3139"></a>

Boolean

## Any

Takes a list of objects and a determines whether one or more of the items meets a specified condition.

#### Syntax <a href="#pragma-line-3148" id="pragma-line-3148"></a>

```
Any ( Objects [, ObjectName] [, Condition] )
```

#### Parameters <a href="#pragma-line-3154" id="pragma-line-3154"></a>

***Objects***\
&#x20;List of objects which will be evaluated.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition*** (optional)\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3169" id="pragma-line-3169"></a>

Boolean

## Count

Takes a list of objects and returns the number of objects in that list.

#### Syntax <a href="#pragma-line-3178" id="pragma-line-3178"></a>

```
Count ( List )
```

#### Parameters <a href="#pragma-line-3184" id="pragma-line-3184"></a>

***List***\
&#x20;List of objects to count.\
&#x20;Type: List\<Any>

#### Return Type <a href="#pragma-line-3191" id="pragma-line-3191"></a>

Int

## Distinct

Takes a list of objects and a selection criteria as input and and selects by a specified criteria if objects are different. Returns a list of those distinct values.

#### Syntax <a href="#pragma-line-3200" id="pragma-line-3200"></a>

```
Distinct ( Objects [, ObjectName] [, Selection] )
```

#### Parameters <a href="#pragma-line-3206" id="pragma-line-3206"></a>

***Objects***\
&#x20;The list of objects which will be examined.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Selection*** (optional)\
&#x20;Selection Criteria.\
&#x20;Type: Any

#### Return Type <a href="#pragma-line-3221" id="pragma-line-3221"></a>

List\<Any>

## ElementAt

Takes a list of Objects and returns the object at the given Index.

#### Syntax <a href="#pragma-line-3230" id="pragma-line-3230"></a>

```
ElementAt ( Objects , Index )
```

#### Parameters <a href="#pragma-line-3236" id="pragma-line-3236"></a>

***Objects***\
&#x20;The list of Objects to get the object from.\
&#x20;Type: List\<Any>

***Index***\
&#x20;The Index of the Object to get.\
&#x20;Type: Int

#### Return Type <a href="#pragma-line-3247" id="pragma-line-3247"></a>

Any

## First

Takes a List of Objects and returns the first value which satisfies the condition. If no condition is specified, it returns the first object. It returns null, if no item can be found.

#### Syntax <a href="#pragma-line-3256" id="pragma-line-3256"></a>

```
First ( Objects [, ObjectName] [, Condition] )
```

#### Parameters <a href="#pragma-line-3262" id="pragma-line-3262"></a>

***Objects***\
&#x20;List of objects used as basis for the operation.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition*** (optional)\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3277" id="pragma-line-3277"></a>

Any

## GetGroupKey

Gets the Key of a Group (created by GroupBy).

#### Syntax <a href="#pragma-line-3286" id="pragma-line-3286"></a>

```
GetGroupKey ( Group )
```

#### Parameters <a href="#pragma-line-3292" id="pragma-line-3292"></a>

***Group***\
&#x20;The Group to get the Key from.\
&#x20;Type: List\<Any>

#### Return Type <a href="#pragma-line-3299" id="pragma-line-3299"></a>

Any

## GroupBy

Takes a list of Objects and groups them by value retrieved by the Selection criteria.

#### Syntax <a href="#pragma-line-3308" id="pragma-line-3308"></a>

```
GroupBy ( Objects , ObjectName , Selection )
```

#### Parameters <a href="#pragma-line-3314" id="pragma-line-3314"></a>

***Objects***\
&#x20;The list of Objects to Group.\
&#x20;Type: List\<Any>

***ObjectName***\
&#x20;Variable Name to identify the object in the Selection criteria.\
&#x20;Type: String

***Selection***\
&#x20;The Selection criteria.\
&#x20;Type: Any

#### Return Type <a href="#pragma-line-3329" id="pragma-line-3329"></a>

List\<Group>

## Last

Takes a List of Objects and returns the last value which satisfies the condition. If no condition is specified, it returns the last object. It returns null, if no object is found.

#### Syntax <a href="#pragma-line-3338" id="pragma-line-3338"></a>

```
Last ( Objects [, ObjectName] [, Condition] )
```

#### Parameters <a href="#pragma-line-3344" id="pragma-line-3344"></a>

***Objects***\
&#x20;List of objects used as basis for the operation.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition*** (optional)\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3359" id="pragma-line-3359"></a>

Any

## Many

Takes a list of Objects as input and determines, if the list which is filtered by a condition, contains more than one item.

#### Syntax <a href="#pragma-line-3368" id="pragma-line-3368"></a>

```
Many ( Objects [, ObjectName] [, Condition] )
```

#### Parameters <a href="#pragma-line-3374" id="pragma-line-3374"></a>

***Objects***\
&#x20;List of objects which will be evaluated.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition*** (optional)\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3389" id="pragma-line-3389"></a>

Boolean

## None

Determines whether no object exists which meets a specified condition. If no Condition is specified the list checks whether the List is empty. If the list is empty the method will return TRUE.

#### Syntax <a href="#pragma-line-3398" id="pragma-line-3398"></a>

```
None ( Objects [, ObjectName] [, Condition] )
```

#### Parameters <a href="#pragma-line-3404" id="pragma-line-3404"></a>

***Objects***\
&#x20;List of objects which will be evaluated.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition*** (optional)\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3419" id="pragma-line-3419"></a>

Boolean

## One

Takes a list of Objects as input and determine whether at least one object exists which meets a specified condition. If no objects are provided the function will return FALSE.

#### Syntax <a href="#pragma-line-3428" id="pragma-line-3428"></a>

```
One ( Objects [, ObjectName] [, Condition] )
```

#### Parameters <a href="#pragma-line-3434" id="pragma-line-3434"></a>

***Objects***\
&#x20;List of objects which will be evaluated.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition*** (optional)\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3449" id="pragma-line-3449"></a>

Any

## OrderAscending

Takes a list of objects and a selection as input and orders the objects according to the selection in ascending fashion.

#### Syntax <a href="#pragma-line-3458" id="pragma-line-3458"></a>

```
OrderAscending ( Objects [, ObjectName] [, Selection] )
```

#### Parameters <a href="#pragma-line-3464" id="pragma-line-3464"></a>

***Objects***\
&#x20;List of objects used as basis for the operation.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Selection*** (optional)\
&#x20;The selection which is used as criteria for the ordering.\
&#x20;Type: Any

#### Return Type <a href="#pragma-line-3479" id="pragma-line-3479"></a>

List\<Any>

## OrderDescending

Takes a list of objects and a selection as input and orders the objects according to the selection in descending fashion.

#### Syntax <a href="#pragma-line-3488" id="pragma-line-3488"></a>

```
OrderDescending ( Objects [, ObjectName] [, Selection] )
```

#### Parameters <a href="#pragma-line-3494" id="pragma-line-3494"></a>

***Objects***\
&#x20;List of objects used as basis for the operation.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Selection*** (optional)\
&#x20;The selection which is used as criteria for the ordering.\
&#x20;Type: Any

#### Return Type <a href="#pragma-line-3509" id="pragma-line-3509"></a>

List\<Any>

## Reverse

Takes a list of Objects and reverses the Order.

#### Syntax <a href="#pragma-line-3518" id="pragma-line-3518"></a>

```
Reverse ( Objects )
```

#### Parameters <a href="#pragma-line-3524" id="pragma-line-3524"></a>

***Objects***\
&#x20;The list of Objects to reverses.\
&#x20;Type: List\<Any>

#### Return Type <a href="#pragma-line-3531" id="pragma-line-3531"></a>

List\<Any>

## Select

Projects each value of the \<see cref="CollectionElement.Objects"/> into a new form.

#### Syntax <a href="#pragma-line-3540" id="pragma-line-3540"></a>

```
Select ( Objects , ObjectName , Selection )
```

#### Parameters <a href="#pragma-line-3546" id="pragma-line-3546"></a>

***Objects***\
&#x20;List of Objects which are evaluated.\
&#x20;Type: List\<Any>

***ObjectName***\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Selection***\
&#x20;The selection which is used as criteria for the select.\
&#x20;Type: Any

#### Return Type <a href="#pragma-line-3561" id="pragma-line-3561"></a>

List\<Any>

## Single

Returns the single value (that met a \<see cref="Condition"/> if one is provided).

#### Syntax <a href="#pragma-line-3570" id="pragma-line-3570"></a>

```
Single ( Objects [, ObjectName] [, Condition] )
```

#### Parameters <a href="#pragma-line-3576" id="pragma-line-3576"></a>

***Objects***\
&#x20;List of Objects which is evaluated.\
&#x20;Type: List\<Any>

***ObjectName*** (optional)\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition*** (optional)\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3591" id="pragma-line-3591"></a>

Any

## Skip

Skips a number of Objects and returns the rest.

#### Syntax <a href="#pragma-line-3600" id="pragma-line-3600"></a>

```
Skip ( Objects , Count )
```

#### Parameters <a href="#pragma-line-3606" id="pragma-line-3606"></a>

***Objects***\
&#x20;The list of Objects to skip from.\
&#x20;Type: List\<Any>

***Count***\
&#x20;The amount of Objects to skip.\
&#x20;Type: Int

#### Return Type <a href="#pragma-line-3617" id="pragma-line-3617"></a>

List\<Any>

## Take

Returns a number of Objects and skips the rest.

#### Syntax <a href="#pragma-line-3626" id="pragma-line-3626"></a>

```
Take ( Objects , Count )
```

#### Parameters <a href="#pragma-line-3632" id="pragma-line-3632"></a>

***Objects***\
&#x20;The list of Objects to Take from.\
&#x20;Type: List\<Any>

***Count***\
&#x20;The amount of of Objects to Take.\
&#x20;Type: Int

#### Return Type <a href="#pragma-line-3643" id="pragma-line-3643"></a>

List\<Any>

## Where

Returns a list of Objects which satisfy a specified condition.

#### Syntax <a href="#pragma-line-3652" id="pragma-line-3652"></a>

```
Where ( Objects , ObjectName , Condition )
```

#### Parameters <a href="#pragma-line-3658" id="pragma-line-3658"></a>

***Objects***\
&#x20;List of Objects which are evaluated.\
&#x20;Type: List\<Object>

***ObjectName***\
&#x20;Variable Name to identify the object in the condition.\
&#x20;Type: String

***Condition***\
&#x20;Condition used to evaluate the list.\
&#x20;Type: Boolean

#### Return Type <a href="#pragma-line-3673" id="pragma-line-3673"></a>

List\<Any>

## &#x20;<a href="#pragma-line-3678" id="pragma-line-3678"></a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tivity.one/building-an-application/execution/scripting/functions/collection-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
