I am new to UiPath and programming. Can someone help me in addressing the below query:
How can i add column to existing data table validating with Date column. As per below
DemandID RequiredBy DemandStatus Ageing
123456| 25 Dec 2018 Not Done I need days difference from B col(RequiredBy to Date.Now
654321 01 Feb 2019 Done
231654 01 Feb 2019 Done
564321 01 Feb 2019 Done
102020 01 Feb 2019 Done
123333 02 Jan 2019 Not Done
I tried adding data column activity. After that I have to give expression to fetch the ageing difference from today. I dont know which activity to use further
Let us take you are having a dataTable dta
Now Add Column Ageing to dta by using Add Data Column Activity.
Now run For Each row for dta
Now Inside ForEach, Use One Assign Activity. row(“Ageing”)=(DateTime.Now-DateTime.ParseExact(row(“RequiredBy”).Tostring,“dd MMM yyyy”,System.Globalization.CultureInfo.InvarientCulture)).Days.ToString
This error is because the spelling of Invariant is wrong as @MAHESH1 is mentioned, that’s why you are getting that error. “InvariantCulture” is the correct one!
Hello @mohammed.khan39
you are getting this error because your datatable DT is not initialized…
move add data column activity after assign activity ( where you are assigning DT = ExtractDataTable…)