Solved

Email Query

  • 6 December 2022
  • 6 replies
  • 93 views

Badge +5

Hello,

I need to get the count of how many emails came from a particular sender and particular subject in last 2 hours. Is this possible, if yes kindly assist. Thanks in anticipation!!

icon

Best answer by Tamil Arasu10 6 December 2022, 19:15

View original

6 replies

Userlevel 3
Badge +7

Hi @gauravr13 ,

 

Please try with below options, i believe this will help you 

 

Note : You need to given -2 hours from current date&time, then loop the email and count it.

 

 

Userlevel 7
Badge +10

Hi @gauravr13,

 

If the number of mails in the Inbox is huge, then what I would recommend is try adding a Rule in Outlook to automatically receive all communications from this particular sender to a Subfolder. Later, you can loop inside this subfolder to check the total count.

 

Instead, if you loop inside the Inbox, the execution time will be more depending on the number mails inside of it.

Badge +5

Hi @gauravr13,

 

If the number of mails in the Inbox is huge, then what I would recommend is try adding a Rule in Outlook to automatically receive all communications from this particular sender to a Subfolder. Later, you can loop inside this subfolder to check the total count.

 

Instead, if you loop inside the Inbox, the execution time will be more depending on the number mails inside of it.

Hi @Padmakumar ,

Thanks for your response!

Can you let me know how I can read the body of any email?

Userlevel 7
Badge +10

 

Hi @gauravr13,

 

If the number of mails in the Inbox is huge, then what I would recommend is try adding a Rule in Outlook to automatically receive all communications from this particular sender to a Subfolder. Later, you can loop inside this subfolder to check the total count.

 

Instead, if you loop inside the Inbox, the execution time will be more depending on the number mails inside of it.

Hi @Padmakumar ,

Thanks for your response!

Can you let me know how I can read the body of any email?

While looping, the output will be assigned to a Dictionary variable. You can mention the emailMessage key to read the Email content.

 

Refer the below links for additional key value pairs for Email Dictionary variable.

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-using-email-properties.html

 

Badge +5

 

Hi @gauravr13,

 

If the number of mails in the Inbox is huge, then what I would recommend is try adding a Rule in Outlook to automatically receive all communications from this particular sender to a Subfolder. Later, you can loop inside this subfolder to check the total count.

 

Instead, if you loop inside the Inbox, the execution time will be more depending on the number mails inside of it.

Hi @Padmakumar ,

Thanks for your response!

Can you let me know how I can read the body of any email?

While looping, the output will be assigned to a Dictionary variable. You can mention the emailMessage key to read the Email content.

 

Refer the below links for additional key value pairs for Email Dictionary variable.

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-using-email-properties.html

 

Hi @Padmakumar ,

Thanks again for your response, it really helped.

I am facing another challenge on this. If I provide a subject in loop condition, somehow it is taking more subjects also (for example - I gave subject as ‘Test’ but it is taking subject ‘Testing’ as well). Any way to avoid this??

Userlevel 7
Badge +10

Hi @gauravr13 ,

 

It is mentioned that When Subject contains. Which means, it will take whatever text you gave there and search inside the folder. The search is not exclusive and hence, it will return whatever Subject lines which has the search text included.

So, in your case, TEST is included in TESTING. Hence the result will include both.

 

Go with some specific text which is relevant to a particular mail communication.

Reply