Each day I need to have my robot locate a file on a internal network drive. The file is located in a folder that is named as the current date(YYYMMDD). Is it best practice to do a file exists first or jump directly to browse for folder? If the current date folder is missing, I will need to email the team that we have an exception. Also, how can I write the variable to account for a folder path with a changing date folder(N:\TSI\RPTS\20231215). I see advice for Studio, but not Studio X users. Any assistance you can offer is appreciated. If you know of any links to help work with dated folders please share.
You can go to date folder like this
Path.Combine("N:\TSI\RPTS\",Now.ToString("yyyyMMdd"))
This will give path with todays date
Also it is better to use path exists/ file exists to check for folder and file and use a if condition with the boolean output and throw error as you need
Cheers
HI,
It’s better to check if the folder exists in advance because basically it’s difficult to handle exception preciously, due to GlobalHandler in StudioX.
How about the following step?
Regards,
Thanks Anil:
Should I use Studio X activity ‘Create Variable’ with this or ‘Open Advanced Editor’ and place it there?
I am not sure what are the limitations of each feature and would like understand when to use one vs the other.
Thanks for your feedback.
Kimberly Caller | Business Systems Analyst, Digital Solutions | CAO PHONE # 913.905.8197
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.