> For the complete documentation index, see [llms.txt](https://hiimmaxx7s-organization.gitbook.io/gpm-automate/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hiimmaxx7s-organization.gitbook.io/gpm-automate/no-code-automation/cac-block/for.md).

# For

## Các tham số trong vòng lặp For

| Tham số      | Giải thích                                                                                                            |
| ------------ | --------------------------------------------------------------------------------------------------------------------- |
| `$loopIndex` | `$loopIndex` theo dõi số lần lặp trong một vòng lặp, giúp xác định và truy cập từng phần tử trong danh sách hoặc mảng |
| Start        | Giá trị bắt đầu của biến lặp `$loopIndex`                                                                             |
| End          | Giá trị kết thúc của biến lặp `$loopIndex` là End-1                                                                   |
| Increase by  | Bước nhảy của biến lặp `$loopIndex`                                                                                   |

Ví dụ: Kết hợp For để đọc file Input Excel. Giả sử bạn cần đọc dữ liệu tất cả dữ liệu từ cột B từ 1 file excel tên là test. Dùng biến **$inputExcelTotalRows** kết hợp với For.

<figure><img src="/files/TaBW1mE5Xx0xUShhYJds" alt=""><figcaption><p>Input Excel</p></figcaption></figure>

<figure><img src="/files/IYa6ggSaLccD64iYvKvH" alt=""><figcaption><p>For</p></figcaption></figure>

<figure><img src="/files/ErkBJUkmOD3EWiSBN55j" alt=""><figcaption><p>Set variable</p></figcaption></figure>
