Get IMAP Mail Messages - Dynamic Filter Expression

Hi all! Every morning I want to download attachment from email with Subject: MGM POS Report mm/dd/yyyy (e.g. MGM POS Report 01/19/24).

I am using Get IMAP Mail Messages and tried to use Filter Expression as below:
“SUBJECT ““MGM POS Report “””+now.AddDays(-2).ToString(“MM-dd-yy”).Replace(”-”,“/”)

Error: Get IMAP Mail Messages: The IMAP server replied to the ‘SEARCH’ command with a ‘BAD’ response: Could not parse command

Any ides, suggestions how to handle this? I am self-starter :slight_smile:

Hi @eddie_mastro

Can you try the below filter expression:

"SUBJECT:\"MGM POS Report " + Now.AddDays(-2).ToString("MM/dd/yyyy") + "\""

Hope it helps!!
Regards

Chat GPT found a solution:
"SUBJECT ““MGM POS Report " + DateTime.Now.AddDays(-2).ToString(“MM-dd-yy”) + “”””

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