Hi.
delete row won’t work in a for each row cycle.
I encontred this problem as well, instead of delete row, assing the index position to a collection, then, in another cycle, loop trought each item and delete them.
But, I’m sure there are another way, let the “pros” come here and solve this.
here i loop trought the datatable to see if the string “Data” appears , for each row increment 1 in the variable “countDataCabecalho”, this way i can add the position of the row in the collection.
“row(0).ToString.Contains(“Data”) and countDataCabecalho>1”
i did this because i want to delete all row with the string “Data” except the first one.
Next:
In the “Add to collection” i subtract 1 because the table start with 0,1,2…
– For each
keep in mind when the first record is deleted the others need to drop a position.
i used the variable “controloItem” to track if is the first remove row or not
I don’t really understand what I’m doing wrong, after testing i either get :
a blank sheet with only the headers
all the %'s removed
nothing changed.
Im trying to make it say
“if there is a % in the “%through contract” column then leave it”
Otherwise
“If there is no % then delete the entire row”
there is a row that i just put “dave” into every column, this would be a bad input so i would like uipath to remove it so i can continue working with the DB
I managed to finally get this working by using a try, “if contains %” assigning the exceptions to to a super high number that would never be achieved, then using a if to filter out the numbers to a report and delete the rows.