Assign folder path

Hi there,

I am trying to automate the process of manually retrieving documents from a specific folder, the problem is that a part of the path is not fixed, the documents are stored in the sub folder named after the date it was created so the folder path will change depending on the document creation date.

For example the path is \123.123\XYZ\2021\08\23\Pineapple.pdf
\123.123\XYZ\ is fixed
2021\08\23 is the part that changes based on the document creation date
Pineapple is the file name

I do have the document creation date stored in a datatable variable called dtExtract in column M, 20210823. Does anyone know of a way to use the data in column M and assign it to form the full folder path? Any help is greatly appreciated!

Since the length of the date string is fixed, you can use the string methods such as .left, .right and .mid to get the numbers you need from each position. I believe you can also use regex.

Just making sure, are you trying to do this in StudioX or Studio?

Hi Prasath, in Studio. I’m new to RPA sorry if my post was wrongly opened, any guidance is much appreciated.

@wcm - you can do in two approaches…Datetime.parseexact (first 3) or substring Method(4th to last) method to extract the Year, Month and day assign it to string variable and then use it in the path variable…

Dear Prasath,

Thanks a lot for the suggestion, I actually do not have any programming knowledge so my understanding could be incorrect. Is it ok to just add \ to the date string 20210823 and then add this variable to the path variable?