[Solved] For each row results in null data from excel

I’ve realized that with some Excels after reading a range of cells and retrieve that information, when I use For Each Row activity, in the iterator variable (normally called row), the information comes into null.

But curiously Data (which is the retrieved DataTable object from ReadRange) is filled.

Hi @enriquediaz

Welcome to the community!!

In the read range activity, have you specified the output to a datatable variable?

Additionally, try to check whether the read range is generating any blank records. You could easily locate it or you use the debug mode. Have a break point on the for each row and run in the debut mode. Once it get to the point where you added the break point, check the values in the datatable variable from the locale panel. You’ll be able to see if rows are getting as null or empty…

2 Likes

@enriquediaz

Try specifying the range property of read range as “” and see whether it makes a difference

2 Likes

The solution for this is really simple. Don’t use variables to retrieve information inside that For Each Row with the name of the iterator variable and the first letter upper-cased.


If you see the name of the DataRow variable inside, in this case is named Row (and the iterator name is row). Avoid the combination iterator name and variable Name or the system will display both variables as empty, even not being declared with same scope.
If I change it for the following:

The system works fine again and row information is inside the variables!

I expect that this thread is usefull for you!

1 Like

Thanks a lot Lahiru, the solution was quite simple, I just wanted to show it to avoid people waste time with this. Is not related with the Excel itself or the range, I’ve tried all of them before. It’s just a question of variables naming as you can see in the solution I’ve provided as reply!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.