Chethan_P
(Chethan P)
August 3, 2020, 1:23pm
1
I get the error in the assign activity when i try to store the date and time i attach the screenshot bellow u check
I get error like this 20.4.3
Source: Assign
Message: String was not recognized as a valid DateTime.
Exception Type: System.FormatException
RemoteException wrapping System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity
1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument
1.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, IDictionary
2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
please help me
Hi @Chethan_P
Can you try the below statement :-
DateTime.ParseExact(CDate(item.Headers("Date")).ToString("MM/dd/yyyy HH:mm:ss"),"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("yyyyMMdd_HHmmss")
Before implementing just have a look to the Date formats those are correct or not as per your requirement
If Yes then you can implement to go further
If No then make changes in the format as per your requirement
Hope this will solve your query
Mark as solution and like it if it helps you
Happy Automation
Best Regards
Er Pratik Wavhal
Srini84
(Srinivas)
August 3, 2020, 3:50pm
3
@Chethan_P
Check below
Mark as solution if this helps
Thanks
1 Like
Chethan_P
(Chethan P)
August 4, 2020, 4:48am
4
hello i get solution from you thank you and i need one more information if i save the folder name as from address for that what should i do for an example if from by Chethan_p@stskproperties.com i want to save my folder chethan_p and date and time what should i do would you pleasae help me for that
Chethan_P
(Chethan P)
August 4, 2020, 6:41am
5
hey some times its work after that i get error like this
20.4.3
Source: Assign
Message: Conversion from string "Thu, 23 Jul 2020 06:09:37 +0000 " to type ‘Date’ is not valid.
Exception Type: System.InvalidCastException
RemoteException wrapping System.InvalidCastException: Conversion from string "Thu, 23 Jul 2020 06:09:37 +0000 " to type ‘Date’ is not valid.
at Microsoft.VisualBasic.CompilerServices.Conversions.ToDate(String Value)
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity
1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument
1.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, IDictionary
2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Hi @Chethan_P
If you are trying to extract the Name from Email then below Regex you can use :-
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
And for Date and Time the same what i told previously :-
Hi @Chethan_P
Can you try the below statement :-
DateTime.ParseExact(CDate(item.Headers("Date")).ToString("MM/dd/yyyy HH:mm:ss"),"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("yyyyMMdd_HHmmss")
Before implementing just have a look to the Date formats those are correct or not as per your requirement
If Yes then you can implement to go further
If No then make changes in the format as per your requirement
Hope this will solve your query
Mark as solution an…
Happy Automation
Best Regards
Er Pratik Wavhal
1 Like
Hi @Chethan_P
So the format of the input got changed thats why it has thrown the error as :-
Message: Conversion from string "Thu, 23 Jul 2020 06:09:37 +0000 " to type ‘Date’ is not valid.
To handle such error you have to pass that format within the solution i gave you already above :-
Hi @Chethan_P
Can you try the below statement :-
DateTime.ParseExact(CDate(item.Headers("Date")).ToString("MM/dd/yyyy HH:mm:ss"),"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("yyyyMMdd_HHmmss")
Before implementing just have a look to the Date formats those are correct or not as per your requirement
If Yes then you can implement to go further
If No then make changes in the format as per your requirement
Hope this will solve your query
Mark as solution an…
Below is the link for various Date & Time Format :-
Happy Automation
Best Regards
Er Pratik Wavhal
1 Like
system
(system)
Closed
August 9, 2020, 5:02am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.