How to Save pdf file in specific location

I need to save a PDF to the exact company folder.

But while saving I need to search for the company folder by using company name and PDF should save in that exact company folder location

Folder structure like this
AML_Process Under multiple Case ID Folders Each Case id folder have multiple sub folders (with name of Company Name ((abc company),(cba company),(xyz company)) like this i have 100 company’s in different case id folders

Kindly help to solve this…

I don’t really understand your problem, but there are several ways to find folders.

  1. If you know all the correct names and case ID’s you could use the ‘path exists’ activity. To create a folder, you can use the ‘create directory’

  2. Another option is to store all the folder names in a certain directory via the .net command "directory.getfiles(xYourDirectoryx). This will give you an array of strings with the found folders

For example:- The below folder structure is created already before process. Now after process I will be getting a PDF file for a respective company ( example :- OCBC.pdf), that PDF file should be save in OCBC folder.

But as we can’t redirect it to particular folder, before saving it we need search for the OCBC folder and open it and save it

Hi!
Append the Folder Path on the PDF file name and move it.

  1. Use the Move File Activity.
  2. Insert the PDF file path in the Path property.
  3. Insert the full folder path with the PDF file name in the Destination Property.
    e.g. File name: sample.pdf
    Destination: ALM\29248\OCBC\sample.pdf
1 Like

You can choose your location, where are you getting that file from exactly? from an email or from where, you can use for example move file activity and choose from where to where.
for choosing the path is not difficult

path = C:\Users\your user\Desktop\Companies\ + nameofcompany

If you are getting from a email there is another way. I need to know from where you get those files

For every run, company name will changes BOT needs to understand the company name and should save it respective company folder.

so , you know every run the name of the company right??

if you can store in a variable the name of the company for every run it is easy, i need to know that

If that is the case, you should also append the company name in the path.
Or you should create an excel file containing the company name and the folder path.
Then once you identified which company folder it should be saved, lookup in the excel file to get the folder path and use it in the destination property.

Above is the test data, each data need to be copied from excel and google it. The Top three URL’s need to opened and save as PDF in respective company folder

i had a similar scenario recently where during the save i used the type into activity with text as “C:\Final data\bills"+companyname+”\final"+finalname

so basically the initial path "C:\Final data\bills" is fixed companyname is a string variable used to identify the company and hence the folder inside bills folder and finally filename is another string variable used to identify and save the file

hope this helps

Good.
So you should have a list of folder directories for each company in an excel file
First, get the folder directory.
Open a browser, search it, click the URL, then print it (ctrl+P).
Then choose ‘Microsoft Print to PDF’
Then on the file name input field, type [folderdirectory][filename]
Click Print

So you can add some logic like:
if (string which you are using for searching on google).Contains(Bank of Nova)
then specific folder ===>> c:users\desktop\specificfolder\Bank of nova.
if (string which you are using for searching on google).Contains(Harley)
then specific folder ===>> c:users\desktop\specificfolder\Harley Davidson.

How many different companies do you have?
Because if they are too much we can create a excel file wich each name and each path for the logic

More-than 100 companies

and more than 100 folders right?

Is, but folder structure like this…

Yes.
You should really have a list of folder paths in an excel file.
Get the folder path one by one and add it in an excel file.
Then use that excel file as reference on where the folder of the company is located.

1 Like

Yes, it is the best way it is going to be a bit tedious to create that list but it is the best way. If you have poblem creating logic for use the excel file list let us know

Right. We are here to help you on how the process should look like. Cheers!

1 Like

Hay, I have the some question. But I have only 5 different folders for saving documents. How can I do that? Is there a different way? Do I need excel file? And if I need them can you show me how that file need to look like?