I have a column called “Name” in a datatable variable, I want to update it to “FirstName”. How do I go about this? I found there’s no activity in UiPath to do this?
I followed the below steps-
Let’s say you have a DataTable variable named dt
, and you want to update the column header from “OldColumnName” to “NewColumnName”. Here’s how you would configure the Assign activity and the Invoke Method activity:
- Assign Activity:
- To:
column
(Create a new variable with this name of type System.Data.DataColumn) - Value:
dt.Columns("OldColumnName")
- To:
- Invoke Method Activity:
- Target Object:
column
- Method Name:
SetColumnName
- Parameters:
"NewColumnName"
- Target Object:
but there’s an error " datacolumn does not have a public instance method “SetColumnName”