For Each & If

Hi guys,

please check my screenshot: like that the workflow is working fine.

  1. reading different pdfs 2) if it finds “Z0001…” insinde the pdf then 3) move file and 4) sending an email

Now i would like to do the same for “Z0002…” I thought I could just copy+paste the red marked section and change “Z0001…” to “Z0002…” But if i do that the robot is not doing anything after the red marked area anymore…

Any ideas what I am doing wrong? Many thanks for your help!
Best Markus

Remove the Continue activities. That activity is designed to break you out of the current item in the loop and go to the next one. So if your first If is false, it just loops to the next item in the For Each, and skips your other Ifs.

Also, the assign to the File variable is unnecessary. You can just directly put Directory.GetFiles… into the “in” portion of your For Each.

1 Like

Thank you a lot!

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