How To Get Only Headers From A Datatable In UiPath

Some times you might want to copy the schema of one excel to another excel.

Let’s see how to do that with UiPath…

dt_New=dt_Original.Clone


Example

Implementation using UiPath :

Let us implement a workflow which takes a “DataTable” and displays the “Headers” of it.

Step 1:
Drag “Build Data Table” activity into the design panel and populate it with some sample data.

UiPath Reverse a Datatable 1

UiPath Reverse a Datatable 2

Step 2:
Drag “Assign” activity into the design panel and fill it with above-mentioned code.

UiPath Copy onLy Headers From One excel to another excel 1

Step 3:
Drag “Output Data Table” activity into the design panel and convert Datatable to String type.

UiPath Copy onLy Headers From One excel to another excel 2UiPath Copy onLy Headers From One excel to another excel 3

Step 4:
Drag “Message Box” activity into the design panel to display the reversed data table.

UiPath Copy onLy Headers From One excel to another excel 4.PNG

Step 5:
Finally, let’s run the project.

UiPath Copy onLy Headers From One excel to another excel 5

Click here to download the Source Code…

Hope it has helped you… 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: