How to use add data row if there is already value in datatable?

I have use add data row to ouput my datatable. I wrote A column and started to wrote B column, but it looks weird as below.
I need to add data started from B2, but it appears in the wrong place.


Hi @CharlotteG

I think you want to add a row at specific index right ??

Thanks,

yes, I wrote A column from A2,and I would like to start writing B column from B2, C column from C2

Hi,

Perhaps you should use assign as the following instead of NewRow and add data row.

img20211129-7

Regards,

please make sure that you have enabled add headers in the write range activity

Thanks, but as you can see from my excel, I would like to add several rows to excel. so I should use rowindex to replace the row(1)?

Hi,

Can you try as the following?
Iterate items for additional data and check if row index is greater than number of rows.

Regards,


I tried as you instructed, but it seems there is only one row, I have 11 rows to be written

Hi,

Can you try to set index variable at Index property of ForEach activity?

Regards,


I changed dt.Rows(index)(1) as above.

Hi,

I think column name is better as you done.
If you still have the above problem, please check scope of index variable.

Regards,

would you pls tell me what additionalList stands for?

oh, I kind of getting what you are talking about, my index value is not a variable, it is a fixed value.
But I don’t know how to solve my problem.

Hi,

Please set the variable at Index property of ForEach activity, as the following.
If you already have variable named “index”, please create another variable, for example named “counter” etc.

Regards,

1 Like

oh it works! Thank you so so so much!

1 Like

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