Need to get mail message only if included attachment - get outlook mail message

Hi Team,

I Need to get only mail with attachment please, how can i configurate the activity please or with save attachment

Activity : get outlook mail message

Thank you

Hi @Soudios ,
You can achieve through DASL query or by looping through each email message in get outlook mail message

DASL Query: “@SQL=”“urn:schemas:httpmail:hasattachment”" = true"
You need to write this query in the filter property

Or, you can store emails into list and Use an If condition inside the loop to check if the mail message contains attachments by evaluating the Attachments.Count > 0.

@Anjani_Kapoor

DASL, you mean here ? :

image

A runtime execution error dialog for "Get Outlook Mail Messages" in UiPath indicates that a VisualBasic expression requires compilation to run. (Captioned by AI)

issue :
Get Outlook Mail Messages: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

Please remove the quotes “” and type again if you are copy pasting the expression

Hello @Soudios

You can use this filter example to only get emails with attachments.

For more filter examples check here:

Cheers

Steve

1 Like

Hi @Steven_McKeering

Can you give the right sentence for my issue, i can’t find it on the post

@Anjani_Kapoor

i have this issue :

The image shows an error message in UiPath's Expression Editor indicating issues with the syntax and declaration of variables in a SQL filter expression for retrieving Outlook mail messages. (Captioned by AI)

@Soudios

Just copy this …

"@SQL=""urn:schemas:httpmail:hasattachment"" = true"

Cheers

@Anil_G
Same

The image shows an error message within an Expression Editor in an automation tool, indicating multiple syntax errors related to a query filter expression for retrieving Outlook mail messages. (Captioned by AI)

@Soudios

I missed an inverted comma at the atart please add or I edited copy it

Cheers

can you past it here please?

@Soudios

I added it in previous comment only please copy it again

Cheers

You have removed the quotes i think

so what is the good sentence ? with or without i have an error message

DASLQuery.txt (52 Bytes)t

Please copy paste the attached code.

@Anjani_Kapoor
not working

Hi @Soudios

Can please you try this

"@SQL= urn:schemas:httpmail:hasattachment=true"

Also, you can check this thread

Hello @Soudios

Try this query:
contains(subject,‘YOURxSUBJECT’) and (hasAttachments eq true)

Just replace the capital letters with the text with the subject you need.

Cheers

Steve

i have this issue :
The image shows a UIPath Expression Editor with an error message indicating issues with the filter expression syntax for retrieving Outlook Mail messages. (Captioned by AI)

hi @rashmisingh2695

When i put this : “@SQL= urn:schemas:httpmail:hasattachment=true”

The bot open an email without attachment and write 2 existing path of attachment but they are not on the email

and now i have this issue :
An error message from UiPath indicates that the "Get Outlook Mail Messages" activity requires compilation and has thrown a "System.NotSupportedException". (Captioned by AI)