# Array

The Array blocks in the GraphLinq IDE are designed to provide users with robust functionalities for managing and manipulating arrays within their graphs. These blocks are pivotal in handling collections of data, allowing developers to store, retrieve, and process elements in a structured manner. Through these blocks, users can effectively manage lists of data, perform operations on array elements, and control the flow of data within their graphs, making them indispensable for dealing with complex data structures.

The [Add Array Element](/dev-tooling/blocks/array/add-array-element.md) block allows users to add a new element to an existing array. This block is crucial for dynamically expanding arrays, enabling the insertion of new data points into a collection.

The [Clear Array](/dev-tooling/blocks/array/clear-array.md) block is used to remove all elements from an array, effectively resetting it to an empty state. This block is essential for scenarios where data needs to be cleared or refreshed within an array.

The [Create Array](/dev-tooling/blocks/array/create-array.md) block enables users to initialize a new array with specified elements or an empty structure. This foundational block is vital for starting data collection processes and establishing the basis for array manipulations.

The [Each Element In Array](/dev-tooling/blocks/array/each-element-in-array.md) block iterates over each element in an array, allowing for individual processing of array elements. This block is key for scenarios requiring element-wise operations or inspections within an array.

The [Get Array Element](/dev-tooling/blocks/array/get-array-element-at-index.md) At Index block retrieves an element from an array based on its index, providing access to specific data within the array. This block is fundamental for targeted data retrieval and manipulation within arrays.

The [Get Array Size](/dev-tooling/blocks/array/get-array-size.md) block returns the number of elements in an array, enabling users to understand the scope of their data collection. This block is important for managing array bounds and for loop control in data processing tasks.

The [Keep Last X Elements In Array](/dev-tooling/blocks/array/keep-last-x-elements-in-array.md) block retains only the last specified number of elements in an array, removing all others. This block is particularly useful for maintaining a relevant subset of data in dynamic scenarios where only recent data points are required.

Overall, the Array section in the GraphLinq IDE equips users with a comprehensive set of tools for array management and manipulation. From creating and populating arrays to processing and analyzing array elements, these blocks offer a versatile range of functionalities to handle various array-related scenarios, enabling developers to efficiently manage collections of data within their graph designs. Each block provides unique capabilities, catering to different array management needs and ensuring effective data organization and processing.

<br>


---

# 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.graphlinq.io/dev-tooling/blocks/array.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.
