Outlook subject congfig code and date variable query

Wanted to extract email based on subject containin xyz, abc and mnc or mncs, where in xyz and abc are common and mnc may also become mncs. Also that code has to be given in config fole where as i have to do this weekly, so the mail should only read for last 7 days only from today. Is it possible for that we can create a date variable in workflow and code for mail be taken feom config file. If yes, what option can be entered in filter wherein the system can read last 7 days email alsong with the code for subject from config file.

@Abhi_G_G

Please try this

"@SQL=(urn:schemas:httpmail:subject Like '%" + in_Config("Key).ToString.Replace(",", "%' OR urn:schemas:httpmail:subject Like '%") + "%') AND urn:schemas:httpmail:datereceived > '" + Now.AddDayss(-7).ToString(“dd/MM/yyyy 00:00:00")+ """

In config you can store the subject values as comma separated values

Cheers

Hi Anil, could you assist what exactly would be the key in_Config("Key) or is it a general code that should be used as it is. And thank you for the assistance.

@Abhi_G_G

in setting page add SubjectValue on name column and in value column add xyz,abc,mcn

and use in_Config("SubjectValue").ToString

cheers

Hi, I tried but was not able to get the exact result…for eg: I want to retrieve the emails containing subjects such as “MY” “HOME” “WORK”, and this MY , HOME and WORK also has to be pulled from config file and have to get the details for the last 7 days from my outlook email mail box… Here in attached screenshot for reference… I was looking for the option where in the words are in 3 different filters, so that later on If I want I can change the filter option rather than having them in one place with , as a differentiator.
image

You can also consider the work around:

Create a subfolder in outlook, create a forwarding rule with the keywords so all these mails containing the keywords in the subject line get moved to the subfolder, then your bot only reads from that subfolder.

Inbox\SubfolderName

The advantage to this is, you do not need to store the filers in the config, you can manage the outlook filters directly from outlook without having to redeploy your code.