How to insert a datacolumn with data to a existing datatable with data, can´t use for each because the datatable and datacolumn it´s very large

i have a very large Datatable, i need to insert a datacolumn with same rows count data, can´t use for each loop because i have more than 50k rows and more than 300columns in datatble. I try with add data row activity but i have error (Add Data Column: Column ‘AnyColumnName’ already belongs to another DataTable.) I try rename the column with any name and error don´t disapear.

Hi @rene_garcia1
Welcome to the UiPath Community!

How many columns do you need to add?
If you’re using Add Data Column activity, you only need to use it once for each column you want to add. You won’t have to loop 50k+ times (unless you want to give a different value for each column). Even if so, the Add Data Column activity needs to be called only once.
You can use the Default Value property to give one same value to all rows for that one column in question.

I hope this helps.
Also, can you share a screenshot of your Add Data Column code (including properties window) and the error message?

Hi, i need add just one column, that column have especific data and same rows number than datatable

Since you want to add specific value for that column in each row, I am afraid it will have to be through a loop.
May I ask why such huge data in a single datatable?
There is merit in reconsidering the design to maybe reduce the size of the data held in the table in a given instance.

Is it possible to use SQL instead of having everything in datatable and filter out based on some criteria? that will reduce the size of the data.

the amount of data is given by the client, it is telemetry data. I have built in sqllite, I could use it somehow to give some solution

That’s definitely recommended.
In a worst-case scenario, imagine the machine or robot running out of memory or processing power and since your data manipulation is only managed within a datatable, it might lose all the previously processed rows.

Consider splitting the data using some tracking method, e.g. having a Status column in the database table and update it as you go along.