Outlook - Filter emails based on subject date

Hello all!
I am trying to get attachments which has subject “SEW_PaymentList-dd/mm/yyyy”( where where date keeps changing).

How to download attachments which has current date in subject.image

Hi @Dinesh_Babu_S ,

Please try to add Convert.ToDateTime(now).ToString("dd/mm/yyyy”) within the Filter option from the Get Outlook Mail Messages activity

UiPath

Best regards,
Marius

Hi Marius.

I tried the above code, but getting ERROR:Get Outlook Mail Messages: Condition is not valid.
image

1 Like

“[Subject]=‘SEW_PaymentList-dd/mm/yyyy’”

try this filter
@Dinesh_Babu_S

1 Like

put this string in the filter field. This way it can filter by the subject

"@SQL=urn:schemas:httpmail:subject like 'SEW_PaymentList-" + now.ToString("dd/MM/yyyy") + "%'"

image

1 Like

Hi pradeep.
I tried the above code but getting error in for each .
For Each: Object reference not set to an instance of an object.

Hi jack.

I tried the above code but getting error in for each .
For Each: Object reference not set to an instance of an object.

can you upload your sequence here

Sure.
Main.xaml (6.0 KB)

This should be equal to Mymails, you forgot to fill in the output

Thank you. Its’s working fine now. :grinning:
Could you please check this as well.

Sorry for the trouble.
Seems its working fine when others run it. But its throwing error in my system.

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