Moving files from one folder to other

Hi,
First of all; I just started my RPA journey and have no previous experience with programming. I would be forever grateful if someone could help me out with my problem.

I am trying to create the following process:

I have a folder with a bunch of Invoice pdf files. I am able to extract the data from the invoice pdf and upload in my web application. In some pdf’s data is incorrect so, that pdf will fail and other pdf will continue uploading.
Till here everything is fine…

But the challenge is
the failed pdf file should be in the same folder and uploaded pdf files should move to other created folder.
Thanks in Advance!!

1 Like

we have Move File activity for that.

yes but it moving all the files in the folder

so what part you cant seem to do?

@Rajashekar ,

So Inside the foreach loop wher you are iterating the pdf files. Take a Boolean variable say IsSuccess whose default value is False.

whenever the Pdf is processes successfully in web - set this flag to True.

Take an If Statement inside the Loop only and Check if the Flag is True
– Move the pdf to The Folder.
else
– Do NOthing

This way you will always have the Unprocessed pdf there only.


Mukesh

1 Like

@Rajashekar,

Try Directory.Move(String, String) Method

thank you all issue resolved

1 Like

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