How to I add data to a cell in a DataaTable?

I have added 3 columns to a datatable, now I would like to populate some of them with information. I want to know which method I should use in my For loop top add the data to the data table.

I can’t find one, DDG can’t find one, and the forum can’t find one.

I might be overlooking something obvious, since this is my first foray with VB and VB.net

@Robot.Builder.9001

Use Add DataRow activity and pass values to add data to DataTable.

Pass array row like this:

           {"Value1","Value2","value3"....}
1 Like

@Robot.Builder.9001
On case of open questions e.g. Activities the Docu is the first point of rescue, after browsing activities in the Studio, left side panel:

https://docs.uipath.com/activities

Hello you can pass values using Add data row activity to output DataTable as {“Value1”,“Value2”,“Value3”} Here I’m passing variables to outBuild DataTable so refer below snapshot.

If I am in the row looking at things, won’t adding a new row add it to the bottom? How do you add a row on top of itself?

Does adding a row on top of itself clear out any data that exists in the row already?

Sorry for double letters, new keyboard is on the fritz.

The datatable already has data in it, and I need to flesh it out with the 3 new columns I added.

so you want to insert new rows at bottom or new rows from the top of the table
or to append rows or to overwrite rows
sorry for the lengthy question… :smile:
Cheers @Robot.Builder.9001

hmm…ok
–so better create new datatable
–use add datarow activity and add data with for each loop
–write that in same excel sheet with WRITE RANGE activity so that it will overwrite

Cheers @Robot.Builder.9001

So … what’s the point of adding a column to a data table if you can’t add data to the cells in the new column?

This is not related to an Excel sheet.

You just use assign activity like this:
myRow(0)=myvalue

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