Check each data in datatable

Hi guys.
I have a problem that I want to check data line by line in datatable.
For example dtname(1)(0).ToString = dtname(0)(0).ToString and I check the condition in for each loop.
When the robot runs,it says null reference exception and stop.But when I output with log message,the data comes out.
If anyone has a thought,please give me an advice.
I’m sorry if my english words are not well.

Aung Kyaw Zin

Buddy @Aung_kyaw_zin

Welcome back to UiPath community buddy


  1. Kindly use for each row loop to iterate through the datatable named out_dt

  2. Moreover before using for each row loop, once after getting the datatable from the excel with read range activity, use a assign activity like this
    row_1_value = dt.Rows(1)(0).ToString

  3. Then inside the for each row loop pass the input to loop with variable out_dt
    inside the loop use a if condition like
    if the condition gets passed go with then part of activities or go with else part of activities

  4. Thats all buddy you are all done…the reason why you get this error the variable that you have used is with null value thats why

Hope this would help you


Ok bro.I’ll try it.

Great buddy, kind let whether this works for you are not @Aung_kyaw_zin


Thanks bro.It works.:smile:

1 Like

Amazing buddy keep going


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