111153
(환민 제)
September 3, 2021, 8:20am
1
I want to send Outlook email by using Excel data.
Send emails 2 days earlier than date data automatically.
Teach me the process.
To find date, what do I have to use? Output of ‘ReadRange’ is ‘Datatable’, so I can’t insert it on ‘If’ because, it needs ‘string’
How can I find 2days earlier data?
How to Send emails using the email address written on 3rd column?
Hi @111153
Step1: Read range the excel using excel or workbook activities
Step2: use for each row of the readDatatable.
Step3: If condition inside the body of the loop.
Condition Currentrow(“Date”).toString.Equals(Now.addDays(-2).toString(“yyyy-mm-dd”)
Step4: Send outlook message To mail Currentrow(“Email”).ToString
Regards
111153
(환민 제)
September 3, 2021, 8:31am
5
Thanks for answering. I added some pictures.
Is ‘Each row’ functioning for find email address on 3rd column??
Hi @111153
Yes!
Its Specifying the Column index row(2).toString or row(“Columnname”).toString
And You need to use if condition inside the for each loop so that it will iterate through
The column date and if the condtion matches it will fetch the corresponding date column Email id.
Hope this helps!
Regards
1 Like
Hi @111153
I have created a Skeleton for based on your process.
Process with necessary inputs!
Refer to the xaml below!
Test_Sequence1.xaml (8.0 KB)
Regards
Hi @111153
Let me Know if its work for you!
Regards
111153
(환민 제)
September 6, 2021, 12:56am
9
Now I commute and check your solution. Sorry for late and thank you so much.
But… I got some errors yet
when I run this file, Error on if condition, “Column ‘Date’ does not belong to table DataTable” Even though there is Date column. So I changed if condition ‘DateTime.ParseExact(Currentrow(1)~~~’
then Error comes with ‘String was not recognized as a valid DateTime’
Hi @111153
As you see the date column is in index 0 but you have chosen a 1 in currentrow(1) and it indicates the name column
Please try with currentrow(0) in the condition
Hope that clears your issue!
Regards
111153
(환민 제)
September 6, 2021, 5:03am
11
Sorry for bothering you. I used…
DateTime.ParseExact(Currentrow(0).ToString,“yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd-MM-yyyy”).Equals(now.AddDays(-2).ToString(“dd-MM-yyyy”))
→ If:String was not recognized as a valid DateTime.
111153
(환민 제)
September 6, 2021, 5:07am
12
I tried by using this one too, but I got the same result
DateTime.ParseExact(Currentrow(“Date”).ToString,“yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture) = Now.AddDays(-2)
Hi @111153
If possible can you share me your source excel file that you re using?
Regards
Hi @111153
Try with the xaml below.
If the Condition matches then send Mail using Mail Activites.
Main.xaml (7.1 KB)
Regards
111153
(환민 제)
September 6, 2021, 6:08am
17
OMG It works! really thank you !!!
what was the problem of ‘DateTime.ParseExact(Currentrow(“Date”).ToString,“yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture) = Now.AddDays(-2)’??
what’s the difference of using ‘dateParse’ and ‘DateTime~~’?
Hi @111153
Datetime.ParseExact means parsing the Date to specfied format!
check with the below thread it has a video reference
Hello Arjun,
In this video I do a lot of stuff with String and DateTime:
[UiPath Tutorial for String and DateTime (Use-cases)]
0:35 Examples for Substring functions
4:10 IndexOf and LastIndexOf
5:00 SubString working together IndexOf and LastIndexOf
6:45 Split string by character
8:50 Split string by string
12:00 Lower Case and Upper Case
12:45 Trim
15:05 Compare strings in multiple ways
19:05 Resume of all the String function part
20:05 DateTime to string in multiple way…
Kindly refer to it!
Please mark solution to the post which you find desired!
Regards
1 Like
111153
(환민 제)
September 6, 2021, 6:19am
19
Thank you Have a good day
system
(system)
Closed
September 9, 2021, 6:20am
20
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.