Adding Rows go Columns outside of for each loop and increasing the row value

Hello All,

I am looking for some help in writing the data in the rows

I was able to write in the first row when I am trying to run it for second time it is writing on the same row , as it needs to write in the 2nd row , Any suggestions btw it is not in the loop

Help Appreciated

Thank you

Hi @gvkishore

May I know where you are trying to write the data.
Is it data table or excel ?

If you are trying to add to a data table, add data row activity works.
When you run the project every time, the data table will be initialised as new and it doesn’t contain any data from the previous runs.

In your query you said that when running the second time. In this case your data table doesn’t contain any data from the first run. That is why it is writing every time in the first row.

If you are trying to add to an excel sheet, use append range activity.

Karthik Byggari

Hi @gvkishore
We need to make a increment with the range value in the write cell activity if we are using write cell to write value in a excel column with each row one by one
–Use a read range activity and get the output with a variable of type datatable
–use a for each row loop and pass the above variable as input to it
– within this use a write cell activity where range must be like this in write cell, suppose writing in B column, wtith all the rows in it one by one, with range like this
“B”+Counter.ToString where Counter is a variable of type int32 with default value 2 been mentioned in the variable panel
–next to this we need to use a assign activity like this to increment the value of counter to ensure that the value is written in the next consecutive row. like this
Counter = Counter + 1

Hope this would help you
Cheers @gvkishore