So here is what I have I am trying to move a file “M:\Weekly Reports Open Reqs+Date.Now.ToString(“yyyy”)+Date.Now.ToString(“MMMM.yyyy”)\Open Req Weekly Upload\OpenReq Rhyan (date).xlsx”
to
“https://ENTERYOURURLHERE\PRO III Daily Planned Report +date.now.tostring(MM.dd.yyyy).xlsx”
but i dont think im using the date.now.tostring correctly. basically I will have a file that will rund aily and where i have the MMMM is where i need it to pull the full name of the month EG: July, and where MM is i was told would be 07.23.2019. Could be wrong, i dont know.
Will look like: M:\Weekly Reports Open Reqs2019July.2019\Open Req Weekly Upload\OpenReq Rhyan (date).xlsx
You can combine the two Date.Now functions into one: Date.Now.ToString(“yyyyMMMM.yyyy”)
Windows might have a problem with the filepath having a period in it, I don’t remember if it bans that or not. If so, you should remove it from the date formatting.
You may want to add some spacing around the date so it’s not pushed right up against the other words in the filepath.
Then, to put the file on a sharepoint URL you should install the UiPath Team Sharepoint Activities package from the package manager. The Move File activity is for moving files locally, I don’t think it works with a sharepoint URL (I’ve never tried - it might work great). I’ve never used the Sharepoint activities, but it looks like there is one called Upload File that should do the trick.
As far as formatting goes:
yy - 19
yyyy - 2019
dd - 23 (adds a zero for single digit days)
d - 23
MM - 07
M - 7
MMM - Jul
MMMM - July
There’s a lot more, but these are the relevant ones.
Message: Cannot find a matching quote character for the character ‘"’.
Exception Type: System.FormatException
RemoteException wrapping System.FormatException: Cannot find a matching quote character for the character ‘"’.
at System.DateTimeFormat.ParseQuoteString(String format, Int32 pos, StringBuilder result)
at System.DateTimeFormat.FormatCustomized(DateTime dateTime, String format, DateTimeFormatInfo dtfi, TimeSpan offset)
at System.DateTimeFormat.Format(DateTime dateTime, String format, DateTimeFormatInfo dtfi, TimeSpan offset)
at System.DateTimeFormat.Format(DateTime dateTime, String format, DateTimeFormatInfo dtfi)
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
This appears to be malformed string error. Please check your string construction. I have noticed that the quotes don’t get formatted properly when copying text from a browser. You might want to delete the retype the quotes.
Try this String.Format("M:\Weekly Reports Open Reqs\{0}\{1}\Open Req Weekly Upload\Open Req Rhyan {2}.xlsx", DateTime.Now.Year.ToString, DateTime.Now.ToString("MMMM yyyy"), DateTime.Now.ToString("MM.dd.yyyy"))
This return the following string M:\Weekly Reports Open Reqs\2019\July 2019\Open Req Weekly Upload\Open Req Rhyan 07.24.2019.xlsx