Could you please help me how to download the Particular attachment from the out look based upon the Particular Day.
My Requirement is I have to look check the mails on last Thursday or Friday date for a particular user and have to download the Particular attachment among the Different Attachments.
so If i am running the bot today(17/08/2022) I have to look in to the outlook for the (11/08/2022 and 12/08/2022) Day mails for a user(Example:Srinivas) and in that mail there will be many attachments and I have to download the Only one attachment (Ex: Data File)
Thanks For Quick reply, I can able to filter using the subject and as well as Sender. But I want to download the particular attachment among all the Attachments available.
I tries like item.attachments.contains(βValue Requiredβ)
Get current weekday
WeekOfDay (of type System.DayOfWeek)= System.Globalization.CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(FilterDate)
FilterDate is of type DateTime (initialize Now value)
Use an While loop and check if : WeekOfDay= DayOfWeek.Thursday
in loop body assign FilterDate = FilterDate.AddDays(-1)
Update WeekOfDay value as per above expression given in step 1.
Once it matches you will be having last week Thursday date in your FilterDate Variable.
Use get outlook mail message and use filter Property to filter and read Thursday Email (you can add +1 and use And operation in filter to read Friday as well)
In Save attachment activity filter provide the required file extension.
Ex : .xlsx|.pdf
You can use the β[Received] >= 'β + DateTime.Today.AddDays(-(Convert.ToInt32(DateTime.Today.AddDays(-4).DayOfWeek))).ToString(βdβ) + " 00:00AMβ AND [Received] <= β"+ DateTime.Today.AddDays(-(Convert.ToInt32(Now.AddDays(-5).DayOfWeek))).ToString(βdβ) + " 23:59β" this expression in the Filter property of get outlook mail message.
In Save attachment activity filter provide the required file extension.
Ex : .xlsx|.pdf
In the Log message I am able to get the Last thrusday and friday dates but While i am using in the outlook Filter condition This is Trowing an error like βCANNOT PARSE CONDITION ERROR ATβ8/11/2022β.
I directly use your condition in the Filter section in the Outlook activity