How to read only 1 Unread email at a time and mark it as read

Hi Team,

I have a scenario where i want to read 1 email at a time and mark it as read after processing.

As per activity i can notice there is one property in Get Exchange Mail message
named as TOP but it’s only reading the top email that means first email in the inbox. Which will not helping me for scenario. As if 2 emails comes in it will not consider the second one.

Any Suggestions @aksh1yadav , @loginerror , @ClaytonM

Thanks

@Rashmi You may have to loop the Count of Emails, So First use Get Exchange Mail Messages, Use Its Output to get the Total Count, Then Use Get Exchange Mail Message with Top as 1 and Select Mark as Read Inside a For Each Of the List of Messages Count.

1 Like

hi @Rashmi

You can read all the Mails once, put it in a List and re-order the list in descending order like Listname.OrderByDescending(function(x) x). so that you get the Old mail first.

then use index to get the Mail message.

1 Like

Hi @Rashmi in outlook mail property select both unreadmessages and mark as read .If u want to mark it as read at the end of the process the best way will be be move to another folder and use another get outlook mail message and select top 1 and mark as read and onlyunreadmessage option checked.

1 Like

I have the exact same issue. I need to read each unread email from exchange server evaluate attachments and then take some (like moving some of the emails to another sub-folder for a different process. But the “GetExchangeMessage” is unable to use the two values in conjunction. “Unread Email” and “Retrieve only one email”. So making the email as “read” has no affect._Test.xaml (6.8 KB)

Hello, How about create custom activity to deal with exchange service (invoke exchange API) and use.