Loop through sub-folder by Reframework and Move pdf's to specific folder

Hello Friends,

I am working on pdf automation and face some issues.

My requirement is:-
Bot should go Main Folder-then there will be sub folders by person names- then open 1st folder then open Outbond folder then there is pdf’s which bot have to move in completed folder and save all pdf names in excel which have moved in completed folder.

This is the process which bot should do for all folders.

Need code in Re_framework only.

I am sharing project folder. Data available in Main_folder
Pdf_Upload_Automation.zip (1.6 MB)

I am struggling to loop in folder to folder, so please someone can help me

@Jeeru_venkat_Rao

  1. In initialize state → first run if condition use arrdirectories = directory.GetDirectories("MainFolder")
  2. Change the transactionitem to string
  3. In get transaction data instead of queue …use if condition with in_TransactionNumber <= arrdirectories.Count on then side use out_transactionitem = arrdirectories(in_transactionnumber) on else side use out_transactionitem = Nothing
  4. Now in process.xaml use Path.Combine(in_Transactionitem,"outbound") in for each file in folder …which will get all pdf and use move file inside with currentitem.FullName as input and destination folder as Path.Combine(in_Transactionitem,"outbound","Completed")

Cheers

1 Like

Its working fine upto here. So how we can update data in excel?

@Jeeru_venkat_Rao

Use build datatable…and then create what columsn you need in process.xaml start…

Use add data row inside your for eqch file in folder and add the filenames or folders anything you need

Then after loop use append range

Cheers

Ok got it.

I want only file name but in my scenario it shows complete file path.


I tried- path.getfilename(Currentfile) but it throw error

@Jeeru_venkat_Rao

Currentfile.name is what gives name of file

Cheers

Thanks @Anil_G , its working fine

I want to write in excel, I placed write range workbook in end state, is that correct?

1 Like

@Jeeru_venkat_Rao

then build datatable should be there in initialize and then you need to pass the datatable in and out of process xaml then can use write range in end process

cheers

Thank you so much @Anil_G .

By your help I solved this assignment in less time.

Thanks again.

1 Like

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