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.
Hi @rohan.joshi,
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
Regards
Balamurugan
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.
Hi @balupad14,
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.
Hi @rohan.joshi,
Here I have attached a sample for you.
File :DataTable.xaml (8.7 KB)
Regards
Balamurugan
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.