---
title: "Assign Iterator In Loop To Variable Step"
url: "https://docs.robotiq.ai/en/article/assign-iterator-in-loop-to-variable-step"
language: "en"
last_updated: "2025-12-24T15:00:05.799Z"
---

# Assign Iterator In Loop To Variable Step

The Assign Iterator In Loop To Variable step saves the current iteration number of a loop to a variable. This helps you track how many times a loop has run.

## How to Use Assign Iterator In Loop To Variable

Use this step inside a loop to store the current loop count.

### Step 1: Add the Step to Your Process

1.  Drag and drop the **Assign Iterator In Loop To Variable** step into your process workflow.
2.  Place it inside a loop structure.

### Step 2: Configure the Variable

1.  In the step's properties, find the **Variable** field.
2.  Enter the name of an existing integer variable.
3.  If the variable does not exist, Robotiq.ai will create a new integer variable with that name.

**Important:** This step only works within a loop.

## Parameters Explained

**Step Name** (Optional)

-   A custom name for this specific step in your process.
-   This helps you identify the step in the workflow editor.

**Variable** (Required)

-   The name of the variable that will store the loop's current iteration number.
-   This variable must be an integer data type.
-   Example: `loopCounter`
-   Use this variable later in your process to reference the loop's progress.

## Related Articles

-   [Set Variable Value Step - Robotiq.ai Help Center](https://docs.robotiq.ai/en/article/set-variable-value-step)
-   [Define Variable Step - Robotiq.ai Help Center](https://docs.robotiq.ai/en/article/define-variable-step)
-   [Next Loop Iteration Step - Robotiq.ai Help Center](https://docs.robotiq.ai/en/article/next-loop-iteration-step)

## Need Help?

Can't find what you're looking for? Join the [Robotiq Community](https://community.robotiq.ai/home/) to get help from other users and the Robotiq team.

![](https://cdn-assets.productfruits.com/65062874-932b-4c4b-95cc-f9153d99c83b)
