Hi everyone. i am facing this issu how to give dynamic dates in download attachments

hi i am using get imap activity. i need to download files. and i have one dought after 3 days i will run the boat i need whenver i run the boat that date only i need download. example : 1-5-24and i will run boat after 3days already before days mails are there before days mail i dont required . i need only whenver i run the boat i need only that day. how to give dynamic. dates plese give me suggitions and if u possible give me work flow

@Venky_Mama

Use the below in filter and you would get only todays mails always

"SINCE " + Now.ToString("dd-MMM-yyyy")

Cheers

1 Like

Hi @Venky_Mama

Check this

Regards,

but it create date and time but i need to i will run the boat after 3 days only i need to that mail
s download sir

i will run boat that day mails only download.before days neglecting give me suggitions sir

@Venky_Mama

The above expression will give only todays mail not any other day

cheers

@Venky_Mama

Add Variables:

  • Create a variable today of type DateTime and set its default value to DateTime.Now.

Configure Get IMAP Mail Messages Activity:

  • Add the Get IMAP Mail Messages activity.

  • Configure the server, port, email, and password properties.

  • Set the **MailFolder property to “INBOX”.

  • Use the Filter property to filter emails received today. The IMAP filter syntax can be used as follows:

    “[Received] >= '” + today.ToString(“dd-MMM-yyyy”) + “'”

Set the Filter property to the above expression. This will ensure only the emails received on the current date are fetched.

  • Process the Emails:

    Loop through the list of emails received using a For Each activity.

    • TypeArgument: System.Net.Mail.MailMessage
    • Values: messages (output from Get IMAP Mail Messages)

    Inside the loop, use the Save Attachments activity to save attachments from each email.

    MailMessage:* item (from the For Each loop)*
    FolderPath:* “C:\path_to_save_attachments”*

This workflow ensures that whenever you run the bot, it only processes and downloads attachments from the emails received on that particular day.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.