Robot skip for each row data table

Hi, I want to ask about for each row data table.

What I want to do:
For example: In Excel and for sheet1. If have status “failed” with data and not have any data with status null then delete sheet and proceed to another process.
If status " " (which is empty/null) but have data, then proceed to another process for insert another data and must in new sheet.

Note: in excel right now just test for status “failed” after run robot does not delete sheet and skip for each row.

I used to do for each row and if activities, but empty sheet does not delete.

Did I do something wrong. Please assist me. Thank you.

These is my workflow:

Hi @nurainfatihah.hamirruddin

Do you face any error?

Have you run the process in Debug mode? Ran the process in Debug mode and share the screen shot of the error


Hi @nurainfatihah.hamirruddin
are you checking just one column values
and on the base of that you are taking decision.

Hi, Thank you for your feedback.

yes, I try run in Debug mode and no error.

But the result is sheet 2 does not delete. There is no data. What I want do is if no data then delete the sheet.

Yes, because I want the values status “Failed” remove other than that just keep in the value.

Hi @nurainfatihah.hamirruddin

Can you share the sample input excel file

Instead of Filter data table activity Use Assign activity

Dt2 | Variable Type → System.Data.DataTable

Dt2 = Dt1.AsEnumerable().Where(Function(r) r("Column Name").Tostring = "Failed").CopyToDataTable


@nurainfatihah.hamirruddin I have one more question, are you trying to delete sheet against each “Failed” or just one “Failed”

This the example sample.

  1. i tried run for status failed and empty
    Failed and Empty status.xlsx (8.6 KB)

  2. Should be empty status with data in Sheet 1.
    If have status empty.xlsx (8.6 KB)

  3. What the problem i facing is when I just run for failed status
    There was sheet 1 if dont have any data.xlsx (8.4 KB)

The coding I use for status failed and null working well but just test for failed only have a problem. My aim is Sheet 1 should delete because don’t have any data there.

Hi @nurainfatihah.hamirruddin

Check Out the XAML file

ExcelFilterFailed.xaml (6.6 KB)

Output excel

Failed and Empty status.xlsx (9.3 KB)