I am trying to create a condition in which date is returning from Abbyy. So if date is greater than 1 year so the DateisValid flag should be false otherwise True.
I am trying to compare date returning from Abbyy. But i am getting this error.
I am attaching the error and date field from Abbyy. Compare Date.zip (11.5 KB)
Abby is returning a string date. You have to convert it using Convert.ToDateTime() before you use it on your condition.
Where did you encounter the error? I tried your workflow and its working fine, all I did is to replace the value of RequestDate to a String date (“16/04/2018”) as I can’t use you in_argument.
yes i am not sure about the string. can you please see my .xaml and also screenshot of date field from abbyy and create a working flow. as i am making a condition if the date from abbyy is more than 1 year the out_DateisValid flag will be true and if not it will be false
agree on @albert.yango mentioned. May be this is not there place you are getting the error. Can you run your code in Debug mode and see what happens? add a breakpoint to the very first activity. right click on the activity and click on toggle break point. Then run in the debug mode. Once the execution gets there, do the execution step by step to see where exactly the error occur…
Taking into account that the abby date has the following format “3/26/2019 10:37:02 AM” then you can use the following pattern to convert it to a dateTime variable:
Please, note that for getting the previous year for a date you can use Now.AddYears(-1) instead of Now.AddDays(-365).ToString(“dd/MM/yyyy”) and you will not have issues with leap years
Please, find an example file 109894.xaml (5.7 KB)
and let me know!