How to remove headers from DataTable using UiPath
While automating business processes we tend to use a lot of input sources like Excel, Database etc.,
When you want to read the data from excel we can easily read them using Read Range Activity and if you want to include headers then check the property add headers property.
But when the datatable is coming from Database you don’t have control over to remove headers.
In this article, let’s see how we can remove the headers from DataTable using UiPath.
Let’s get into the practical implementation of this task:
There are two different ways to do this task:
Step1: Drag and Drop Build DataTable Activity from the activities panel to the designer panel and create a DataTable as shown below:
Step2: Drag and Drop Write Range Activity from the activities panel to the designer panel as shown below:
Here make sure the Add headers property is unchecked as shown below:
Now the DataTable is written in an excel. So you can use Read Range Activity and get the datatable without headers.
Step1: Navigate to the step1 of first method.
Step2: Drag and Drop Output DataTable Activity from the activities panel to the designer panel as shown below:
Now assign the output of this activity to any variable like DTText in this example.
Step3: Drag and Drop Assign Activity from the activities panel to the designer panel and enter the code as shown below:
Step4: The output of the above given code is shown below: