How to get files from user shred path

Hello Team,

I have to get multiple CSV files from user share path and copy that file move to another shared path but the condition is bot check first is all files are there if it’s not bot mail to user den again bot check that files available or not.

There is folder month wise we have to check current month folder inside that file is there

Thanks

Hi @suraj_gaikwad

I didn’t get the first condition. Could you elaborate more?

About check if the month folder exists, what is the name format for the month?

Hi @suraj_gaikwad ,
You need check share path, destination existed, then copy to destination.
But you need check policy of folder with robot
the owner need share role copy to robot
regards,

shared path like this - \10.23.20.50\f\share\Bot\files

Folder should be like this in above image

name of the like above shows image and end of the file name is date format

@Nguyen_Van_Luong1
@rikulsilva

Thanks

Hi @suraj_gaikwad ,
we can call strPath
\10.23.20.50\f\share\Bot\files
strFile = strPath+subPath + file name

subPath is NOV23, OCT23… that’right, they based on time
you can get in current day, that’s right?
you can get by datetime.now.toString(MMyy) , will get as NOV23,…
then get filename :
in this step, you want get file of which month ?
if current month
strFile = strPath + strSubPath+ “MCX_MRG_56520_” + datetime.now.toString(yyyymmdd)
regards,

Yes got it but how can go on shared path

I’m sending hot keys (WR)

And there is multiple folders for I have to find mcx folder

@Nguyen_Van_Luong1

Thanks

Do you need to get the file in the MCX subfolder?
you can put folder path
image
\10.23.20.50\f\share\RPA\MCX
regards,

@suraj_gaikwad

Shared path works just as a normal path…did you try with for each file in folder and for each foder in fodler activities?

Cheers

I tried with file in folder but it won’t work

How I can get file from shared path and it is need to use hot wr to get files?

@Anil_G @Nguyen_Van_Luong1

Hi @suraj_gaikwad ,
You can use for each file in that folder
then file.toString
you will get all file path

Could you show current way get file ?
regards,

@suraj_gaikwad

Can you please show what you tried and what did not work?

Cheers

Hi @suraj_gaikwad

Try this

\\10.32.10.50\f\Share\RPA\MCX\NOV23

All files I got but there is multiple file file in current month and i have to choose specific of file

( I have stored all files name in assign )

@Anil_G @lrtetala

Thanks

@suraj_gaikwad

in the filter of for each file in folder you can give the filename with astrek at the start and end

or can use if condition to check if the filename matches arrfilenames.Any(function(x) Currentfile.Name.Contains(x))

cheers

I got the file but it’s continuous running in loop as per condition

@Anil_G

@suraj_gaikwad

use a break activity in the loop at the end or if using if use it on the true side at the end

cheers

I have to trigger mail as well to user if the file not found mail should be trigger to user

If I used this condition it’s going in else till the get files

If I use mail in else so it’s den it triggers the mail continue

@Anil_G

This logic i have implement in below image once the loop is over

@suraj_gaikwad

do not send email on else side

instead create a boolean variable and set it to true on the then side

after the loop check if boolean variable is true then dont send email else send an email

cheers

I need to copy two specific files from this path

Extension type lst and text
@lrtetala