# Get Value from String Collection

## Overview

This action lets you quickly retrieve a specific value from a collection of text strings. You can get the first, last, or value at a particular position within the collection.

***

## **How it Helps**

Imagine you have a collection of product codes and need to access the third code in the list quickly. This action allows you to do that without writing loops or complex logic.

***

## **When to Use It**

This action is ideal for:

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

***

## **Example**

To get the second item in a list of selected options:

1. **Create a String Collection:** Have a String Collection variable storing a list of options chosen from a multi-select picklist.
2. **Configure the Action:** Select the String Collection variable and choose "At Index" as the operation, specifying "1" as the index to retrieve the second item (remember, indexes start at 0).
3. **Use the Value:** You can use the action's output to, for example, display the selected option in a text field.

***

## **Key Considerations**

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


---

# 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.avonnicomponents.com/flow/actions/data-conversion-and-formatting/get-value-from-string-collection.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.
