I set the value like this : DateTime.ParseExact(in_Config(“Filtered_Date”).ToString, “yyyy-MM-dd”, CultureInfo.InvariantCulture)
of course, I also set Filtered_Date in config file as well. but it didn’t work.
it shows this error
“Invoke Workflow File: String was not recognized as a valid DateTime.”
how can I solve this errors? plz let me know
Additionally, if I have to use another expression or something, could you explain more how to compare the date with others?
@MythicGold uiPath allows you to use arguments of other types than String, eg. Int, DataTable… @Chris_Kim
what is the excact string that you are trying to parse. Go for debugging to find out
Have a look on this demo statement: DateTime.ParseExact(“22.09.2019”, “dd.MM.yyyy”,new CultureInfo(“en-US”) )
@Chris_Kim is it working now? I replicated your error message by e.g a correct date string but a space on the end. Maybe a trim will help: in_Config(“Filtered_Date”).ToString.Trim
Hi @ppr
I’m really grateful for your answers. I tried all the thing what you mentioned. like changed Cultureinfo and add trim end of the ToString. but it doesn’t work. all of those occurs same error. what did I wrong?
@Chris_Kim
In that phase it is recommended to isolate the issue
First of all run on .Net Fiddle https://dotnetfiddle.net/ or on a separate XAML the statement with hardcoded date
DateTime.ParseExact(“01.09.2019”, “yyyy-MM-dd”, CultureInfo.InvariantCulture)
then add a space after 2019 to reproduce your error
then go back to your workflow and test the invoke same with hardcoded date
Once this is working then log out in_Config(“Filtered_Date”).ToString before invoke or inspect while debugging in the locals panel
Keep in mind if date string is not valid, the error message from above is thrown. DataType is DateTime.
It would also be a good check to click on import arguments (invoke activity) and recheck the arguments
Can you post the datevalue configured in the Config.xlsx?
Hi @ppr@jitendra_123
Very thx for helping me and you guys dedication. Actually, I solved it. but I was too busy to comment this post yesterday.
What I have done is that I just check and change excel cell format in Config file. it was set as a date. after changing as a text. it works very well.