How to convert excel sheet to data table and add 2 additional columns with some specific values in uipath?
Use Read Range activity inside the Excel Application Scope activity and mention sheet name you want to read from excel file. The output of Read Range activity is DataTable.
Use Add Data Column activity to add column to existing data table.
Hi Buddy, @Chandni
Here is your xaml that could resolve your issue
The steps included are,
- Use open excel application scope to get the excel first
- Use a read range activity to get the datatable from the Excel with output variable out_dt
3.now use add data column activity to add the data column with the name you want…like column1 - Again the same activity to add one more column…here you can have only one activity within a for each loop( not for each row loop) to add certain number of columns…
Another suggestion is if you want to add columns at specific position, you can use invoke method with object out_dt.Columns.Add and method as SetOrdinal. Where you can mention the position with parameter property of this activity…
All these are added in this workflow buddy
adddatacolumn_1.xaml (11.4 KB)
Cheersr
It’s very simple.
- Can you please use Excel Scope Activity inside that add read range activity to specify your column Name and Range. The output of Read Range activity is DataTable. e.g(Data1)
- Use ADD Data Column activity to add the column to the existing DataTable (Data1).
Can you please check this file.
Here I have created Excel, using add Column activity to add the column name “Booking new status” column.
AddColumnIntoDataTable.zip (9.3 KB)
Thanks,
Arunachalam.
Yeah., I got it, thanks everyone for your help
Great Can you please make a solution so that our folks can get info on this post.
Thanks.
Arunachalam.