Establishing Specific Dates for Sending an Email

Hello all,

I want to identify how I can send an email 2 days after a listed date. Attached are the pictures that I have currently and I am having trouble figuring out what I should put for the condition of the If statement so Uipath knows which dates to look at to send the email. Thank you for your help.

You can use like this:
IF DateDiff(DateInterval.Day, date1, date2) > 2

I used that same exact format and continue to get an error.

you need to replace date1 and date2 with your correct dateTime variables…

should date1 be the date identified in the excel file and date2 is the current date?

date1 is normally the one with todays date…

I am still running into an error when I put in a dateTime variable. I made a constantdate variable with a datetime.Now.ToString(“dd-MM-yyyy”) code.

Dont put “if” inside the condition… also dont convert the dates to string or it will not work…

I took if out, I put dates in with parenthesis (ex. “23-01-2020”) and I still get an error

both your dates must be of type DateTime.

I’ve figured that portion out, now how will I be able to reference my ExcelDates to send an email 2 days after the dates that are listed no my excel sheet.

I assume you have an activity of For Each Row that uses the datatables generated by your read range activities, so your date should come as DateTime or Text, we need to see that first.

Yes I do. I would have to find a way to convert the datatable variable into a datetime variable correct?

it looks wrong to have a read range inside a for each row… is it really like that?

the for each row would get an error if I don’t put it like that.