Optional email download with the same name

Hi, I have 2 emails with the same name address, but I want to download first email only is there any way to save it.
@Palaniyappan @Lahiru.Fernando @lakshman

1 Like

Hi
well we can keep the TOP property of mail as 1 in the property panel of get outlook mail activity
Cheers @balkishan

1 Like

@balkishan,

If you are having the multiple values, then

iterate through the mails and store the mail ID’s in a string type array , and when the loop iterates, check if array.contains(mail.address) , then skip or continue

1 Like

No bro, it’s look diff. My req is diff as @Palaniyappan gave the reply.

I didnt get that buddy
is that the requirement
Cheers @balkishan

1 Like

Yeah ok @balkishan,

Then that would be the easy way to solve that issue as @Palaniyappan mentioned

Cheers bro

2 Likes

Hi @balkishan

You can also get the emails and also sort it by the date and time you got the mails… That’s another way of doing it…

3 Likes

bro, you already replied to that post. your comment is matched with my requirement. Thank you

2 Likes

Oh
Fantastic
Cheers @balkishan

1 Like

Hi can we we sort it by date and time? Can you please explain Or we have option itself in the mail property activity.

1 Like

ths could sort the mailmessages
yourmailmessagevariable = yourmailmessagevariable.OrderBy(Function(x) x.Headers(“date”)).tolist

with that we can take the one we want
Cheers @balkishan

date will be dynamic? what is x bro here ?
mailvariable can be a string type or mail.net.message type?

1 Like

X is a variable use in the function
And yourmailmessagevariable is the variable that we get from get outlook mail activity which is of type List of mailmessages
Cheers @balkishan

1 Like

okay okay understood, thanks you bro :slight_smile:

1 Like

No worries
well i hope the first option of TOP property will probably help you if its a simple filteration
but if we are taking it to a multi thread condition then we can use this expression
Cheers @balkishan

1 Like

As of now I am using the first solution only.

1 Like

Great
Cheers @balkishan

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.