Question

I would like to select exactly that incoming mail in a "for each mail" type loop which one triggered my bot.

  • 12 September 2022
  • 2 replies
  • 4 views

Hi All,

 

I looking for a workaround. I would like to select exactly that incoming mail in a "for each mail" type loop which one triggered my bot. So when an email arrived in the "Trigger loop: Handle" step I assign the email properties to a record. I need to save attachment of this mail, so i create a connection, assign it to a session and after in a loop I try to find the incoming mail in that session with filters. I think the most exact way if I filter the unread mails in the inbox by specific sender and received date too. (Filter to sender is okay.) I assign the record's emailReceivedDate keys value to a Datetime variable and try to use this in the loop's "When received date is on or after (optional)" part but it cant find my mail.

The record's emailReceivedDate keys value is an ISO_ZONED_DATE_TIME, I try convert it into ISO_LOCAL_DATE_TIME, ISO_OFFSET_DATE_TIME, ISO_INSTANT but none of them matched with the loop's received date.

 

Thanks in advance,

Attila  


2 replies

I hope you are using these options as well:

image 

for more information please refer to the official documentation - Using the For each mail in mail box iterator (automationanywhere.com)

Of course yes, but if I set it to True (to use local timezone) it doesn't match with the emailReceivedDate converted into ISO_LOCAL_DATE_TIME. (2022-09-14T09:24:00). And if I set it to False (to use UTC), in that case it should be equals with ISO_OFFSET_DATE_TIME (2022-09-14T09:24:00+01:00) or maybe with ISO_INSTANT(2022-09-14T09:24:00Z) but it deosn't match each of them.

I think that the problem may be that the arrival time of the email in the loop section, neither the localdate nor the UTC doesn't looks like the way I converted the emailReceivedDate from (it's originally an ISO_ZONED_DATE_TIME). Do you know for what should I convert it?

Reply