Build Data Table: How to rename a column?

Now in 2018.3 we have the option to edit column name and it’s properties from GUI…

:robot:

1 Like

Cool thanks. That’s a step forward. Doesn’t allow us to re-order the columns and/or insert new columns though, right? I do that sometimes when I want to add or re-order columns on Excel output files that might get emitted from any given robot. The Excel sheet columns render in the same order as the DT.

Here is a detailed article on that :slight_smile:
# How To Rename DataTable Columns – In UiPath

Regards,

1 Like

Thanks but that’s actually a different use case than what I was asking about. Back in 2017, when we created a DataTable of our own, we were unable to reorder the columns or even rename the columns unless we went into the XAML and manually manipulated it.

This is no longer the case. The DataTable designer has been vastly improved since.

Oh
That’s cool :slight_smile:
Happy to know that!!!

Hi @raj ,

To add or rename multiple column names using @richarddenton method i.e using assign
myDataTable.Columns(0).ColumnName = “newColumnName”
myDataTable.Columns(1).ColumnName = “newColumnName”
myDataTable.Columns(2).ColumnName = “newColumnName”

All you need do is change the index of the column starting index 0 which is column 1.

Thanks