How to remove only data in the multiple column but not headers of that columns.
How to remove the data from multiple columns
Book1.xlsx (10.5 KB)
name,age,salary column data should be removed but the headers should not remove
can you send sample code
Code:
For Each row As DataRow In inputDataTable.Rows
row("Maths") = DBNull.Value
row("Total") = DBNull.Value
Next
Try this
DT.AsEnumerable().ToList().ForEach(Sub(row) {
row(“ColumnName1”) = String.Empty
row(“ColumnName2”) = Nothing
row(“ColumnName3”) = DBNull.Value
})
dt2_Updated.AsEnumerable.Select(Function(r) dt2_Updated.Clone.LoadDataRow({“”,“”,“”,r(3).ToString,r(4).ToString},False)).CopyToDataTable
use this in assign activity
and use write range activity
Code:
For Each row As DataRow In inputDataTable.Rows
row("age") = DBNull.Value
row("BRANCH") = DBNull.Value
Next
O/P:
Book1 (4).xlsx (10.4 KB)
Please find the below xaml for your input excel file
BlankProcess12.zip (129.9 KB)
Hope this helps!!
without write range it will work?
because I dont want to write the data in another sheet just it should remove the data in the current sheet
code to write in invoke code is
dt_Sample.AsEnumerable.ToList.ForEach(Sub(x)
x(“name”)=Nothing
x(“age”)=Nothing
x(“salary”)=Nothing
End Sub
)
It writes within current sheet please look into this
for arguments passing please find below image
dt2_Updated.AsEnumerable.Select(Function(r) dt2_Updated.Clone.LoadDataRow({“”,“”,“”,r(3).ToString,r(4).ToString},False)).CopyToDataTable
Sequence1.xaml (7.8 KB)
The changes should be done in the same sheet
iam getting an error
Can you show that error