Build Data Table: How to rename a column and/or change other properties of the column using the GUI?
You can use an assign activity to do this…
myDataTable.Columns(0).ColumnName = “newColumnName”
If I defined “Build Data Table” definition incorrectly , Simply I want to edit it on Studio GUI.
But UiPath Studio supports Delete and Add Column only instead of Edit after defined once.
Hi Richard, if we have to add multiple column name. Is there a simple way to it or need to put assign service to add each column name.
Thanks for the replies thus far. It still seems silly to me that we can’t simply edit the original “Build Data Table” activity as tango mentions above.
Can you create a list of new column names and loop through it adding each new column dynamically?
I probably could… but my assertion is that I shouldn’t have to.
Is there some reason I’m not getting why we shouldn’t just expect to be able to edit the contents of the “Build Data Table” activity, and have it behave differently on the next robot run?
Yeah sorry, I misunderstood.
It’s in ideas - please bump and upvote to possibly influence when it will happen (BTW - I totally agree with you on this one):
I am facing the same problem. I defined 12 columns in a data table and now I want to edit the datatype of second column. There should be a way to edit existing columns.
If you changed the datatype after you added the data, I think you will get an error like.
“Cannot change DataType of a column once it has data”. You have another way that you can create a new column like existing colum name +“temp”. Copy all the data to the new column that you decided data type. finally remove the existing column and change the new column name by old column name.
It is a little hard process . When you have huge data , may take time
UiPath data tables don’t actually store/persist data like a physical database. They are volatile (like RAM), and only take data in real-time while a robot is running. Therefore… changing a column’s data type wouldn’t be constrained by persisted data.
I don’t have any data in the DataTable, it’s in memory. I just want to edit the 2nd column without deleting the other columns, from 3 to 12.
Be sure to chime in on the feature request link above if you haven’t already.
Here I have attached a sample for you.
File :DataTable.xaml (8.7 KB)
Great that this can be done… but I still think it’s a little silly that one cannot simply open the original DT builder activity and just change the column data type
Hi, i am bit late but there pretty easy way to change datatype or columnname. You need to open your projects .xaml file with notepad and find your data table there, and simply replace datatype/name.
It looks approximately like this:
<xs:element name="COLUMNNAME" type="xs:COLUMNTYPE" minOccurs="0" />
Hi @richarddenton, i am trying this assign activity to update 3 columns however nothing happened. Can you please help out? thanks. Want to change the column named “Name” with new name. Appreciate your help.
See below screenshots.
here is my excel:
Full editor screenshot:
Just FYI to anyone interested, the pattern I’ve found myself doing to compensate for this GUI weakness is to create my DT with just 1 column (incrementing Id or a datetime, etc.) and then use multiple Add Column activities before the process proceeds and uses the DT.
This way, I can always rearrange/add/delete/update any of the columns because they are independent Add Column activities. I am free to manipulate the column names & order however I choose as my needs evolve.