Dividing invoices files

Hey guys,

I am trying to robotise a proces, but i haven’t succeeded yet.
I hope you guys can help me!

The process goes as follows:

In Outlook, we get an email with two kinds invoices (PDF). The invoice that starts with Invoice_100XXX and Invoice_200XXX.

The enclosed pdf invoices must be stored in an folder called “2019”. This step must be dynamic. In 2020, there will be made another folder with the year 2020.
Inside this folder, there are two folders: Invoice_100 and Invoice_200.
Thereafter, there has to be made a folder. The name of this folder must be the date of today (example: 01-01-2019). If this folder already exist, then this part can be skipped.

The invoices 100 and 200 must be divided and moved to the 100 or 200 folder.

So in summary: Folder 2019 → Divide → Create folder in 100 or 200 folder (date of today) → move the invoices.

Thank you in advance!

1 Like

This is very easy to do. Please attend the foundation course and you would be able to do it.
If you have any specific issue or if you are stuck at some point, we can definitely help.

1 Like

Thank you for your fast reply. I have attended and completed the course, but it’s a while ago.
Can you please point me which lesson I have to review?

Thanks!

@Nutella

Have you started anything or not ? Where you got stuck and let us know your issue. So that we can help you.

2 Likes

Sorry for the late reply.

I have started a bit, but it is not much.

What i have done so far is, storing the attachements to a folder called attachements.
The trick now is to divide the Invoice_500xxx and Invoice_100 files to the right folder. (Year → 500 or 100 folder → month —> date that the email was sent)

I hope you can help me figuring this out, because i can’t

Thanks in advance!
Archive Invoice.zip (85.1 KB)

Hello Nutella,

Please try below steps,

  1. Loop each file in the attachment folder. For each file in the folder get the creation date of the file.

  2. Get the year from creation date and store in variable Current_year. Now you got till year in the file path (c:\Current_year) where you want to store the invoice.

  3. Now, check whether the file name includes keyword 100 if yes then append that value to the path (c:\Current_year\100).

  4. Get today’s date.

  5. Check whether there is a folder already exist with today’s date in path (c:\Current_year\100).

  6. If exist don’t create new folder just move the file to the created path by appending today’s date also (c:\Current_year\100\Today_date).

1 Like

Thanks! I will try it out.

1 Like

Hello nutella, Did you got the solution?