Remove data table row

Hii,I’m Using UiPath community cersion 2023.4.
I want to delete row from data table for that I used Remove data table activity but row was not remove.Please check attache screenshot



Please guide me to resolve issue.

@ashwini.mali

If you use remove data row …it would remove from
The datatable and not the excel…

You need to use delete row for excel

Cheers

Hi @ashwini.mali - Did you give the right data table name. Also, can you print the data table and check. Does excel has any data before write the updated data

but i read excel file using read range activity and save read data into exceldata variable and its data type is Datatable ,so that used remove roe activity.
above is not right way? @Anil_G

@ashwini.mali - After deleting row in data table are you writing the data back to an excel or no

@ushu Yess giving right data table name


and same name passed to remove data row activity

no,writing data table @ushu

@ashwini.mali

That is right…but it is right if you want to emove only from the datatable

Once you read the data into datatable there is no relation eith excel now…

If you want to remoce on excel you need to use excel related activities

Now you can write the datatable back and you can see the datarow is deleted if you write the data back …but again the previous last rows will still remain in excel as for example you read 3 rows and delete one row and write back to excl…then the data would be modified for first teo rows and the third row remains as is…that is the last row will be shown teice…one because of deletion it moved up and the other row because it is already present on the excel

If you write to new excel then you can see that the row is deleted

Hope this is clear

Cheers

@ashwini.mali - Can you write the updated data to some sample excel using Write Range activity within excel scope or print the data table in message box after you removing the row. This is to confirm, it was doing as expected or no

@ushu after removing row ,write updated data into message box for testing but row was not remove,
check attached screen shot.

@ashwini.mali - It looks like your excel format is bit different. is it possible to share your sample input excel. Also, you are expecting to remove 1, ACRVIN VENTURES PVT LIMITED … first row data right ?

@ashwini.mali -

1)Also, it looks like you are debugging the project. Can you try using Run button to run your project and check how that goes

2)Also, I’ve observed in your data table, there were additional 94 columns, also in your input excel first row was blank. So, when your trying to Read Range can you mention specific range, “A2:L5”, alphabet L change according to your input excel. Once you change this, try removing data row and check how that goes

I want remove first blank row when i give index number 0 it will remove column heading and when pass 1 then remove 1 row of data but it not remove Blank row @ushu

@ashwini.mali

As first row is not having data i guess when you read the first row is not read at all…

So please use delete row activity with specific row and the position as "1"

This would delete the first row from excel without any thing

Cheers

can i use direct delete rows activity instead of remove row activity?
or used within a use excel activity @Anil_G

@ashwini.mali

Yes you can directly use delete row activity but not in place of remove datarow …you need not read the data only

  1. Use excel file and pas the excel file location
  2. Use delete rows activity…with specific rows and then specify as "1"

Then the row would be deleted

Cheers

@Anil_G please check attache screen shot ,and guide me,
what set in table or range properties

@ashwini.mali - Try giving the table range as Excel.Sheet("Sheet1").Range("A3:L3")

L alphabet has to change based on your input excel last column

Check attached workflow

DataTable (2).zip (10.3 KB)

Input

Picture2

Output

Picture3

@ashwini.mali

Please give like this

Excel.Sheet("Sheetname")

cheers

@ushu @Anil_G Thank you so much ,Issue resolved by using above solution.

1 Like