# Repeating (looping)

### @index <a href="#index" id="index"></a>

* no parameters
* returns a whole number

`@index` — no parameters or parentheses necessary — returns the current iteration number if this function is called from within a “loop”, i.e. when the software cycles between the elements of a list. This is for example the case when [repeating a row in a table](/clauses/introduction-to-tables.md#repeating-rows), or when going through repeating clauses. `@index` will return zero if used outside a loop.

For example, if `#customer^name` is a repeating list that contains the names “John Smith”, “Jane Doe” and “Marie Thompson”, then the following output would be produced in a table with a repeating-row . The @index starts at 1, and is then incremented with each additional row, until the end of the loop.

<figure><img src="/files/qlW3uJJZmZmw9kc78QbU" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note that (unlike most programming languages) the returned number is one-based, i.e. the first iteration in a loop will be one (not zero).
{% endhint %}

{% hint style="success" %}
To get the row-index in the context of a [Q\&A column condition](/qna/adding-conditions.md), use `@row-index` instead.
{% endhint %}


---

# 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://help.clause9.com/special-functions/repeating-looping.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.
