Skip to main content
Solved

Email Query

  • December 6, 2022
  • 6 replies
  • 183 views

Forum|alt.badge.img+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!!

Best answer by Tamil Arasu10

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.

 

 

View original
Did this topic help answer your question?

6 replies

Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+16
  • Most Valuable Pathfinder
  • 3276 replies
  • Answer
  • December 6, 2022

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.

 

 


Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • December 7, 2022

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.


Forum|alt.badge.img+5
  • Author
  • Navigator | Tier 3
  • 17 replies
  • December 7, 2022
Padmakumar wrote:

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?


Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • December 7, 2022

 

gauravr13 wrote:
Padmakumar wrote:

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

 


Forum|alt.badge.img+5
  • Author
  • Navigator | Tier 3
  • 17 replies
  • December 7, 2022
Padmakumar wrote:

 

gauravr13 wrote:
Padmakumar wrote:

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??


Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • December 7, 2022

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings