> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://documentation.celestory.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 🟪 Loop through Object

# 🟪 Loop through Object

${frame}[Video: anatomy of the Loop through an object block](https://celestory-docs-videos.netlify.app/en/anatomie-bloc/loopthroughobject.html)

![Loop through Object](https://celestory-docs-illustrations.netlify.app/en/LoopThroughObject_EN.svg)

The Loop through Object block lets you automatically iterate over every property (key/value) of an Object variable, one at a time.

It is the Object equivalent of the "Repeat" block used on lists: it lets you run the same portion of the graph for each property without knowing their number or names in advance.

## 📥 Inputs

-   in (Stream): Entry point that starts (or restarts) iterating over the object.
-   object (Object): The Object variable to iterate over.

## 📤 Outputs

-   out (Trigger): Fires once per property in the object, as long as there are more to process.
-   index (Number): Numeric position of the current property (starts at 1).
-   key (Text): The name of the current property at this iteration.
-   value (Dynamic variable): The value associated with the current key.
-   end (Trigger): Fires once, after all properties have been processed.

## 💡 Example

**Scenario: Displaying all of a player's stats**

1. A `stats` object contains `{"strength": 12, "agility": 8, "magic": 15}`.
2. A Loop through Object block is connected to `stats`.
3. At each iteration, the `key` and `value` outputs are used to display a line "strength: 12", then "agility: 8", etc.
4. Once all stats have been displayed, the `end` output continues the scenario.

## ⚙️ Technical Details

-   **Internal ID**: `loopThroughObject`
-   **Iteration order**: Properties are generally iterated in their definition order in the object, with no strict guarantee if the object comes from an external source (API).
-   **Nested objects**: If a value is itself an Object, it is returned as-is on the `value` output — use a second Loop through Object block to process it further.

---

*Documented version: v1*