# Custom Loop

> Loop over a customized range of numbers.

- ID: `advanced_custom_loop`
- Type: Loop
- Category: [Utilities](https://inventor.bot/docs/reference/blocks/utilities.md)

> Iteration Number is the absolute iteration number (1-based); Custom Iteration uses your provided values.

- Loop block: write `for item := range advanced_custom_loop(Args{...}) { ... }` and read the current item's outputs from `item`. See loops.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `loop_range` | yes | Examples: 1-10 10-1 1,2,3,4,20-25 | e.g. `"1,3-5,7"` |
| `body` |  | Blocks to run each iteration. | blocks: `func() { ... }` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `iteration_number` | Zero-based iteration index. | e.g. `"0"` |
| `custom_iteration` | Value from your custom range. | e.g. `"5"` |

**Example**

```go
for range advanced_custom_loop(Args{loop_range: "1,3-5,7"}) {
	send_text_message(Args{channel_id: trigger.channel_id, message_content: "Next item"})
}
```