How to delete rows in For Each Row?

Dear Experts

I have an request as below:

Step 1: Input all info from excel to a website one by one(use For Each Row)
Step 2: We need to cancel each row after it fill into website
For example:
After all the info of 1216428758 fill into website, this row need to be cancelled before it goes to 2nd row 1215507673 and continue to fill in the website

But I got error as below, may I know what is the proper way to make it happen?

image
image

Thanks

Hi @yangyq10

Why you want to delete the rows which are processed. You are using for each excel row right it will go through each row in the excel, if one row completed in for each excel row that row will not execute again. Why you are trying to delete any specific reason.

Delete rows activity will not work properly in the For each as they mentioned in the warning, it’s not good to use the Delete rows activity inside for each.

If you describe your requirement then we will give you a different approach.

Hope you understand!!

@mkankatala

Thanks for the quite reply

The reason I need to use delete rows is that the website is unstable(stuck or unable to find some UI)

So I need to put retry scope in the whole process in case sth goes wrong while input

But, each time after I input all info in a row, the website will submit it to system and generate a unique ticket number

If we don’t delete row after input when error occurs, the retry scope will re-input all the rows again into website and create other unique tickets for a same customer#

This behavior is strictly banned from business team in the operation

So I need to find a way to continue input the customer# which start from the one that has error in last run(if there is error indeed)

@yangyq10,

One approach would be, while iteration, store all the rows need to delete in a list or Array.

Once the for each loop finishes, add logic to delete rows and give the range to delete.

Thanks,
Ashok :slightly_smiling_face:

Hi,

The following post may help you.

Regards,