> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/actions/data-conversion-and-formatting/number-collection-get-value.md).

# Number Collection Get Value

## Overview

This action lets you easily retrieve a specific number from a collection of numbers. You can choose to get the first number, the last number, or a number at a specific position within the collection.

***

## How it Helps

Imagine you have a collection of order totals and need to find the highest total quickly. This action lets you retrieve the last number from a sorted collection (assuming it's sorted in ascending order) without writing any loops or complex formulas.

***

## When to Use It

This action is ideal for:

* **Accessing specific numbers in a collection.**
* **Retrieving the first, last, or any number by its position in the collection.**
* **Simplifying number retrieval without manual searching or complex formulas.**
* **Working with ordered collections where the position of numbers is important.**

***

## Example

To calculate the difference between the first and last values in a series of measurements:

1. **Create a Number Collection:** Have a Number Collection variable storing a series of measurements.
2. **Configure the Action (First Value):** Select the Number Collection variable and choose "First" as the operation to get the first measurement.
3. **Configure the Action (Last Value):** Repeat the previous step, but choose "Last" as the operation to get the last measurement.
4. **Calculate the Difference:** Use a Formula element to subtract the first and last values.

***

**Key Considerations**

* **Source Collection:** Ensure you have a valid collection of numbers.
* **Operation:** Choose the appropriate operation:
  * **First:** Retrieves the first number in the collection.
  * **Last:** Retrieves the last number in the collection.
  * **At Index:** Retrieves the number at a specific numerical index (starting from 0)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.avonnicomponents.com/flow/actions/data-conversion-and-formatting/number-collection-get-value.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
