Move PDF files into the correct folders that contains the filename

I was able to build a robot that move the pdf files into the correct foldername using a for each item in arrayfolder (if item.contains(filename) ) then move the file into the correct folder and if not stay in the original location. It works pretty good except the following behaviour (hope you can help :slight_smile: )
When using PDF file name like 824.pdf 24.pdf 2024.pdf 2124.pdf (so the 24 is repeating each time in the file name), then when running the robot => the PDF’s all goes to the correct folder except the number 824.pdf where I obtain the below error message. Do you know what to do to ignore this error or how to build a part of the robot differently to avoid such behaviour?

Move PDF files into the correct folders that contains the filename.docx (286.1 KB)

PS: Noted that when I got this error then I just need to restart the robot and the file can be moved into the correct folder.

In attachment, you will find the whole story. Thanks in advance for your help. This would be much appreciated.


I have a doubt that error message says 24.pdf is not present in the path
But you said 824.pdf is not present in the folder.

Hello @mce

Is this error happening for 24.pdf( as in error) or for 824.pdf.

Which file are you moving manually ? Is it 24.pdf or 824.pdf?

You can use File exists activity to check whether the file exists or not and then use the Move file activity.


Its happening for 24.pdf (see below)

I obtain the error but the PDF file is moved to the correct folder (see below)

I suspect that I only have the error when I’ve similar folders that contains the number 24 like the below example

If I remove the folder 0000824, then I have no error (see below)

Do you know how to proceed in order to avoid having his error message?

PS: I already use a path exist activity (see below)

Thanks in advance for your help.


Hi @mce ,

If you have time please mail to, will share zoom link will join in to call adn sort out the issue.

In the above screen shot what i observe as 24 file is already to some other folder, so only throwing the error.

Thank You!
Pavan Kumar

email sent to you

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