Deleting Final Row from Excel

I have a process that goes through rows in an excel table and when it finishes the work for that row, it deletes the entire row (which moves the rest of the rows in the table up) and moves on to the next. This works as expected until it comes to the last row. It completes the necessary work for the final row but then it fails to delete the row, resulting in an endless loop since data still exists in the table. Does anybody know why it fails to delete the final row? Is it because it is inside of an Excel Table?

This is the activity I am using to delete the top row in the table after each loop.

image

This is an example of what the last row in the table would look like that it fails to delete after finishing the work.

Hi jpreziuso,

Please check the image below:

Cheers!

This isn’t exactly what I am looking for. Ideally I don’t want to change the activities or methods I am using. Was just wondering if anybody had an idea of what might be happening

Deleting the rows as you work them really isn’t an ideal design, and as you see causes issues because it doesn’t want to delete the last row. You should create a dispatcher automation that reads the Excel file and creates queue items. Then your performer automation works out of the queue.

1 Like

@postwick Yes! that’s the reason. Excel Table would require at least a row in it and if you try to delete last one as well, it will be an issue.

May be you can add a blank row at the bottom before you start processing it and while processing and deleting check if the row have some value or not. If no value there then that’s the end for the processing.

Thanks,
Ashok :slight_smile:

Thanks for this explanation. The confusing part is I have another process that works in a similar way and it does not run into an issue deleting the final row after it is done. I will have to look into what to look into what the differences are