Build Data Table: How to rename a column?

excel
activities

#1

Build Data Table: How to rename a column and/or change other properties of the column using the GUI?


Build Data Tableのデフォルト値に変数を使用する方法
#2

You can use an assign activity to do this…

myDataTable.Columns(0).ColumnName = “newColumnName”


#3

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.


#4

@octechnologist
Hi use this flow demo.xaml (14.0 KB)


#5

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.


#6

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.


#7

Can you create a list of new column names and loop through it adding each new column dynamically?


#8

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?


#9

Yeah sorry, I misunderstood.


#10

It’s in ideas - please bump and upvote to possibly influence when it will happen (BTW - I totally agree with you on this one):


#11

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.


#12

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


#13

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.


#14

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.


#15

Be sure to chime in on the feature request link above if you haven’t already.


#16

Hi @rohan.joshi,
Here I have attached a sample for you.

File :DataTable.xaml (8.7 KB)

Regards
Balamurugan


#17

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 :slight_smile:


#18

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" />