How to check all row in two column

Hi, I am new in UiPath and try to do a program that can read all row in column B and column S. If the row in column B don’t have a date then it will go for the next row and continue checking, If the row in column B have a date then will check for the same row in column S, if column S not match with the condition then will send file to wrong folder, if column S is match with the condition then will continue checking for the next row until all the column B and column S in whole file has been checked, then will send file to correct folder. The problem i face is the program will only check once. For example, first row is correct and third row is wrong, but the program i do will only check for first row then direct send file to correct folder. So, how to check all the row in two column?

This are the UiPath program i try to do, please take a look and how should i change?
Main.xaml (13.7 KB)

And this is the excel file that will send to wrong folder.
sample time sheet.xlsx (263.4 KB)

Regards :smiley:

If any one of column row value is empty then you have to send this file to Wrong folder right??

1 Like

In UiPath, you could use a Break activity and a variable to track if all the rows were read without incident, (here, hasAnomaly).

You put a break in both cases: you need to remove it from the branch were no anomaly is found.

ForEach file in Check:

    hasAnomaly= False

    ForEach row in CheckNumber:
      * Case not B -> Next
      * Case B and S match -> Next
      * Case B and S not match -> hasAnomaly to True -> Break

    // ForEach row in CheckNumber has ended
    // still in same file

    If hasAnomaly -> do this
    else -> do that

    // Next file
1 Like

No, if the row empty just continue check for next row. :smiley:

So, what i need to do is just remove the break?

Hi, @msan
If i delete the break, it will have an error.

Your screenshot

The problem in your screenshot is about the path and probably not related to the workflow. Try surrending your path by three double-quotes (as your path has spaces) like:

"""E:\UiPath Projects\CORRECT\sample file correct.xlsm"""

or, more dynamically,

OutputDirectory = "E:\UiPath Projects\CORRECT"
FileName = Path.GetFileName(file)
FullPath = Path.Combine(OutputDirectory & FileName)
EscapedPath = String.Format("""{0}""", FullPath)

The break in your workflow

If my understanding of your need is correct, the file is correct only if you iterate over all the rows without anomaly.

En error is enough to shortcut the iteration and consider the file as problematic.

@msan now i understand thanks! Wish you have a nice day! :grinning:

1 Like

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