# Data Files: Iteration doesnt stop at empty row

**URL:** <https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596>\
**Category:** Feature Request\
**Tags:** feature-request, katalon-studio\
**Created:** [August 13, 2018, 9:24am UTC](https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596 "2018-08-13T09:24:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manu\_Mahendran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/manu_mahendran/32/23869_2.png) [@Manu\_Mahendran](https://forum.katalon.com/u/Manu_Mahendran)\
**Post date:** [August 13, 2018, 9:24am UTC](https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596/1 "2018-08-13T09:24:41Z")

</div>

Need to fix the following  
Delete the contents of a row in the excel by selecting the row cells and clear contents. In this case, katalon doesnt exit data iteration after first iteration. It takes the second row and continue with test execution.  
Katalon should exit the iteration if the first cell in the next row is empty or any otherbetter solution. Currently it only stop if I right click on the row and delete the row

---

<div class="post-metadata">

**Author:** ![Arnel](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arnel/32/6360_2.png) [@Arnel](https://forum.katalon.com/u/Arnel)\
**Post date:** [August 14, 2018, 8:03am UTC](https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596/2 "2018-08-14T08:03:57Z")

</div>

Hi Manu,

Please see the link below. Seems like your issue is the same with this:

> **[Test data - Deleted data gets executed](http://forum.katalon.com/discussion/8617/test-data---deleted-data-gets-executed)**
>
> Hi there, When I have deleted one of the row of the excel sheet \[test data\] from the source file and checked the data in TEST DATA, the serial no of the row was present in the data sheet.

You can refer to my answer on that link and try it on your side.

Hope that helps. . . 🙂

---

<div class="post-metadata">

**Author:** ![Manu\_Mahendran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/manu_mahendran/32/23869_2.png) [@Manu\_Mahendran](https://forum.katalon.com/u/Manu_Mahendran)\
**Post date:** [August 22, 2018, 6:20am UTC](https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596/3 "2018-08-22T06:20:44Z")

</div>

yes it is. I had already figured that out… Can you add a feature to katalon to automatically stop iteration on a blank row

---

<div class="post-metadata">

**Author:** ![Arnel](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arnel/32/6360_2.png) [@Arnel](https://forum.katalon.com/u/Arnel)\
**Post date:** [August 22, 2018, 8:05am UTC](https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596/4 "2018-08-22T08:05:56Z")

</div>

Hi Manu,

On iteration, if you want to stop it when it detects a blank value you can just put a condition and break the loop something like:

Object excel = ExcelFactory.getExcelDataWithDefaultSheet(“yourDataSourcePath”, “sheetName”, true)  
for (int rowCounter = 1; rowCounter \<= excel.getRowNumbers; rowCounter++)  
{  
if (excel.getValue(“ColumnName, rowCounter”) == “”)  
{  
break  
}  
}

Hope that helps. . . 🙂

---

<div class="post-metadata">

**Author:** ![Manu\_Mahendran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/manu_mahendran/32/23869_2.png) [@Manu\_Mahendran](https://forum.katalon.com/u/Manu_Mahendran)\
**Post date:** [August 22, 2018, 8:11am UTC](https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596/5 "2018-08-22T08:11:02Z")

</div>

Thanks @7314-Arnel  
I have already implemented it. I was wondering if it can be take care by katalon iteration feature. like without that extra coding

---

<div class="post-metadata">

**Author:** ![Jass](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jass/32/9588_2.png) [@Jass](https://forum.katalon.com/u/Jass)\
**Post date:** [March 13, 2020, 7:30am UTC](https://forum.katalon.com/t/data-files-iteration-doesnt-stop-at-empty-row/12596/6 "2020-03-13T07:30:46Z")

</div>

Closed on March 13, 2020, 7:30am UTC


