How to remove last values from DataRow

Hi Everyone,
I have to remove last two column values(Completed,Status Meesage column values) from DataRow variable.

Could you please give any suggestions.

Thanks in Advance.

@Suggala_Tejaswi
please follow these steps.
0- read range activity to store data in datatable
1- install UiPath.Core.Activities.RemoveDataColumn package
2- use Remove Data Column activity
3- give dataTable and column name
Note, It will keep coumn name and remove all data

1 Like

Thank you for your quick response.
Here i have to remove last two columns data and data storing in variable (Data type -Datarow).

@Suggala_Tejaswi replace with null values

1 Like

HEY @Suggala_Tejaswi,

First do this dtOutput = dtSource.Clone this way you will get the same structure from source dt to destination dt

Second Use the below linq
(From row In dtSource.AsEnumerable
Select dtOutput.LoadDataRow(New Object() {
row(0).ToString,
row(1).ToString,
row(2).ToString,
row(3).ToString,
row(4).ToString,
row(5).ToString,
row(6).ToString,
row(7).ToString,
row(8).ToString,
β€œβ€,
β€œβ€
}, True)).CopyToDataTable

Thanks,
Sanjit

1 Like

@Suggala_Tejaswi sorry now I am little bit late😁

1 Like

Hey @Suggala_Tejaswi,

If the issue has been resolved kindly mark it as a solution so that it would be helpful for others as well.

Thanks,
Sanjit