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:

First method:

Step1: Drag and Drop Build DataTable Activity from the activities panel to the designer panel and create a DataTable as shown below:

build datatable

Step2: Drag and Drop Write Range Activity from the activities panel to the designer panel as shown below:

write range

Here make sure the Add headers property is unchecked as shown below:

remove headers from datatable

Now the DataTable is written in an excel. So you can use Read Range Activity and get the datatable without headers.

Second method:

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:

remove headers from datatable

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:

remove headers from datatable

Step4: The output of the above given code is shown below:

Happy Learning!

Like this post then let your friends know about this-:

Leave a Reply

Your email address will not be published. Required fields are marked *