Get indexes rows and delete

Hello friends,
@AshwinS2 , @arivu96, @Rammohan91, @balupad14, @Florent_Salendres, @vvaidya, @Palaniyappan, @loginerror, @MAHESH1, @Manjuts90

I need to check if a datatabel has a row containing a specific value and, in positive case, get the index and delete it.

In this case I need to check if colmun rows “percroso_xml” and “percroso_pdf” have certain values. IN case positive, get indexes and delete these rows.
How to do that?
CAn you please share a xaml?
CAmi :slight_smile:

Hope these steps would help you resolve this
—use excel application scope and pass the file path as input
—inside the scope use a read range activity and get the output with a variable of type datatable named dt
—then use a for each row loop and pass the variable dt as input
—inside the loop use use a IF condition and memento in like this
row(“percroso_pdf”).ToString.Equals(“your value”) AND row(“percroso_xml”).ToString.Equals(“your value”)
And if the condition passes it will get into THEN part where we can use ADD TO COLLECTION activity
Where in the collections property mention as list_rowindex, a variable of type system.collections.generic.list(of int32) with default value as new list(of integer) defined in the variable panel and in the item property mention as dt.Rows.Indexof(row)

—now the index value will get added to the collections
—followed by this for each row loop use a for each activity and pass the list variable as input and change the type argument as int32 in the property panel of for each activity
—inside the loop use REMOVE DATAROW activity
Where pass the datatable dt as input and datarow as item which will delete those rows

Cheers @CamiCat

1 Like

Thank you so much @Palaniyappan.
Cami :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.