Read range and add data row errors

I have been having issues trying to read data from an excel file then add it to a data table i built then write the data table to an excel file, please how do i go about it?
here’s the workflow Test.xaml (35.4 KB)

You’ll be happy to know that reading an Excel sheet to a datatable is made very easy with UiPath. I’ve attached the workflow with the only activity you’ll need to read the data from a sheet in your workbook. (13,2 Ko)


I can’t open the workflow please re-upload

Please post the error you’re seeing when trying to open the file.

1 Like

It isn’t loading stuck at this

Try unzipping the file and reading from the extracted contents. Make sure it’s downloaded to the C: drive (e.g. in your Downloads or Documents folder). I have had cases where reading the data from a ZIP file or from a network drive causes UiPath to take a long time on this page.

If that doesn’t work, delete the project.json file and open Main after extracting.

1 Like

It has opened but please check out the workflow i uploaded to better understand what I’m saying

1 Like

I’ve had a look at your workflow, but I do not recommend reading the document this way. The more stable way is to read the sheet or sheets into one or more datatables in UiPath and manipulate the data from those tables. This will reduce the number of activities you need to search or modify specific rows.

1 Like

So how do i search for a variable cell data and read the row in which the cell data is found and get certain certain cell data based on column and then write it into a datatable

You can use the Filter Datatable activity. Filter for the value in the column you need, and the datatable will then only contain the data where the data you’re looking for exists. If you want to preserve the original datatable, you can specify a different datatable for the output of the activity.

1 Like

Oh great but how do i search for a particular cell value and get the index?
Please help i’ve been on this for too long.

What do you need the index for? I ask because while there is a way to get the index, there may be an activity which does what you need without needing to know the index.

1 Like

Okay, here’s a breakdown of what i want to achieve

  1. Open an Excel file
  2. Search for a cell data
  3. Get items (not all) from the row in which the cell data is found
  4. Use the items to fill up another excel file

Ok, in that case you won’t need the index. When you filter the datatable, you can use the Write Range activity to write the rows containing the data you’re looking for to a new Excel file. This should reduce the number of activities needed to 3:

1.) Read Range to get the data into a datatable.
2.) Filter Datatable to filter for only the data you want.
3.) Write Range to write a new Excel file containing only the filtered data.

1 Like

Let me try it out

Please checkout the workflow and see the error message i’m getting

The column name you provided isn’t in the data table. It looks like the default column names of “Column1”, “Column2”, etc. are being used. Check what’s in DT1 after getting the data, and use that column name in the ‘Column’ field of the filter. Alternatively, you can provide the index of the column in the ‘Column’ filter. So if you know the data you’re filtering is in the 3rd column, set ‘Column’ to 2, since the column indices start at 0 and count up (no quotes around the 0).

Hi @Anthony_Humphries,
I’m not getting the desired result, do i need to do anything here in output columns

You will not need to change the output columns. This is only used if there are columns you don’t want from the data sheet.

I’m only getting the header as result in the new excel file