Looping Pdf's with conditions

Hi guys,

Please check my screenshot, I managed to read some pdfs from a folder,
now I would like to loop through all the pdfs and if i find a name, i.g. “Schmitt” (somewhere inside the pdf) I would like to move the pdf to another folder, if not the bot should continue with the next pdf…

I am not sure with which acitivities I have to continue now and where to put them, can someone help?

Many thanks,

Hello @Markus3003 ,

The name “Schmidt” should be in the file name? (pdf name)
Or should be in the text inside the pdf file?

For the second one, you should use Read PDF activity.

I hope it helps.


1 Like


Inside the For Each

If Schmitt present in the file path

Place an IF condition in that check


Then->Place Move file activity

If you want to check inside the PDF file

Then Place a Read PDF file activity inside the For Each activity

Check the IF condition as the output variable of Read PDF file activity

Hope this may help you


1 Like

text inside pdf.

Please check my screenshot:

Does it look right? Not working so far, I am not sure what to put in the “else” condition, can I use “continue” there?

Thank you!!

Well, at Read PDF text you should put the variable File, not the folder path.

The folder path is just a folder, not the Pdf file, as per the screenshot.

Give it a try.


Not working yet

@Markus3003 - If its not confidential or sensitive data in the pdfs, it is possible share atleast 2(one with Schmitt) ? I will build the sample workflow and share it.

1 Like

Still, curious which part not working.
You should put some Log messages, to see where is failing.

Run it in Debug Mode, and check the activity that is failing.

I believe should work OK, till MOve File.
There, in FROM should be the full path of the file. Or simple put the variable File there.


1 Like

It is working now guys, Thank you a lot! I had to modify the move file activity!

@wasea I had to put “item” instead of “File” in the “From”

That’s great.

Happy Automation!

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