Hello community,
I am newbie of UiPath and I need your help to complete my first RPA workflow.
I have an excel document. This document has two columns. First column has date information (MM-dd-yyyy), second one has some kind of information. All I want to do is, the RPA workflow check date information in the first table and if any row is existing in the column which is matching with current date, then send an email to someone with second column information.
Buddy may i have that excel sample buddy @Sweetmisery
its easy we can do this
but would like to know the format of that date column…before starting
Cheers
Result with >1 rows, data will be copied to NewDtVariable, send emails using For-each-row loop
Result with 0 rows, the syntax will not copy rows to datatble, use an IF condition with DTVariable.Select(“[Column1_Name]='”+DateTime.Now.ToString(“MM-dd-yyyy”)+“'”).ToArray().Count>0
then inside the send outlook mail activity you can include the row(“Message”).ToString
either to body or the subject buddy as you wish
Kindly try this and let know buddy whether it worked or not
Cheers…
if any error occured with string format conversion to datetime, kindly use a write line to check how the date text is getting printed in which format after obtaining from excel, based on that we can the format in the if condition buddy @Sweetmisery
use this in your if condition buddy Datetime.Parseexact(row(“Schedule”).ToString.Substring(0,10),“MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”).Equals(now.ToString("dd/MM/yyyy))
you have - instead of /
thats why showing error buddy
try the above highlighted and that would work for sure buddy
Cheers @Sweetmisery
This is working Correctly.But If My Reqirement is only match Between Current system’s date & month to the schedule’s date & month only Not The Year.Can You Please Help me.
Hi
Welcome to uipath community
If the schedule_date is 20-12 stores in a string variable named in_date
And if we need to compare this with the system DateTime
Then in if condition DateTime.ParseExact(in_date,”dd-MM”,System.Globalization.CultureInfo.InvariantCulture) > DateTime.Now
In My Excel Sheet The Date is ex:- 08-06-2017(“MM/dd/yyyy”).I want to match only date and month(“MM/dd”) with the current date & month(“MM/dd”) Not The Year.
hi i am facing similar issues but when i am putting the condition in the if statement it is moving in he else part instead of then part.
my problem statement is to match the excel date with current date.