How to get the oldest unread email from Gmail

I am trying to get the oldest unread email from a specific user.

What i have been trying

image

Please suggest the possible way.

Hi @NJ0011,

Have you tried using a Get Exchange Mail Message activity? I imagine this would work with your Gmail account, though I have not tried it with my Gmail account.

You can set the OrderByDate property to OldestFirst, and take only the first item:
image

@NJ0011 You are saying that oldest unread emails, is there starting with specific date that you are looking for to get the emails. Please use below thread for info

Hi @NJ0011 ,

Could you let us know what is the Error faced when using the Activity ?

It gives the first order by New unread mail found, However i am trying to get the last mail from Unread.

@NJ0011 ,

I believe you do receive all the unread mails.

If that is the case, you could reverse the order of the Output mails received

Let’s say, we have the output as a GmailMessage[] type, say having variable name gmailMessages

Then you can do the following Assign Operation to order the list from Oldest to First :

gmailMessages = gmailMessages.Reverse.ToArray

Let us know if it doesn’t work.