How to write the data row in excel


I Have a data table and i need to use that data table in for each loop with some if condition. If the condition satisfy i need to write the value to excel
for next iteration the value need to append - please assist on how to perform the activity

1 Like

Hi @Fresher

You can try adding the value to a new DataTable if the condition is met. Once the new DataTable contains all values, then you may use write range activity and use the DataTable as input.



Append range can also be used to Excel append.


Hi @Fresher,

Covert the datarow to datatable like bellow. And use the write range activity to write into excel…

DataTable dt1 = dr.CopyToDataTable();



Thanks you friends… am able to execute my activity and obtained the output
thanks for all your time and suggestions

1 Like


iam trying to filter the datatable using the date condition is if loop.
with assign activity am able to filter the data table with date condition
dt =“date < ‘2018-07-27’”).CopyToDataTable
could you please assist me on how to use it in if loop
row(“Date”).Is LessThan(2018-07-27) - but am getting the error

The condition is am using the for the each loop to iterate the datatable. inside the for each loop am using the if condition and if the date is less than 2018-07-27, i need to write the data in workbook