Not able to rename column

Rename Bot.zip (25.5 KB)

Dear Team,

PFA,
I’m not able to rename column name in excel.

Please check and suggest some good solutions.

1 Like

you can do this
DataTableVar.Columns(“yourColumnName”).ColumnName = “YourNewColumnName”
Cheers @SAHIL_PANDITA

1 Like

i’m attaching you a sample workflow to rename
Re-Name Column Names.xaml (6.2 KB)
Cheers @SAHIL_PANDITA

Hi @SAHIL_PANDITA,

Check the AddHeaders property of write range activity.

Thank you

Hii Jyotika,

It works but instead of replacing the column name (Namee to Name and Agii to Age) it add another column.
Rename Bot.zip (25.5 KB)

image

Hii Pradeep,

The above query works but it is not replacing.
image

Hi @SAHIL_PANDITA

Check this

Or use Excel application scope and there is rename column activity

Thanks
Ashwin.S

before writing in write range use write cell activity
and give value as nothing and range “”

Hi @SAHIL_PANDITA,

Can you explain your requirement in detail.

Hi @Jyotika_Halai

Try this use remove data column and use add data column

Thanks
Ashwin.S

1- read range, mydatatable
2- mydatatable.columns(“namee”).columnName = “Name”
(do it for agii too)
3- write range, mydatatable

Here you go
i have modified a activity in your xaml
hope this would help you
Rename File.zip (17.6 KB)

Cheers @SAHIL_PANDITA

Hii Jyotika,

I want to rename only Column3 (Name to PetName).(Please refer Image 1)
Note : There is two same field name “Name” in column 0 and column 3.
image
Note : I implemented the above solutions but it doesn’t rename the field name, it adds one more column line. (Please refer Image 2)
image

I attached the file please check and revert.

Rename Bot.zip (25.6 KB)

Hii Palaniyappan,

I refer your file but in that file, you are adding the column but my point is to rename the column.

image

I want to rename Column(3) Name to PetName.

Note : There is two same field name “Name” in column 0 and column 3.

Hi @SAHIL_PANDITA

Check this Rename Bot (2).zip (22.0 KB)

Thanks
Ashwin S

Hi @AshwinS2,

You are using invoke code activity.
Instead you can use an assign activity.

Thanks,
Karthik

@SAHIL_PANDITA Check this RenameBot.zip (19.7 KB)