How to move outlook one folder to another folder based on Attachment name

Hi Team,

I am using “Get Email” and “Move Email” activity Office 365 scope outlook, I have input attachment name
Attachment name mail should move one folder to another.

Input: Attachment name = xxx.pdf

I tried "hasattachment eq true and contain(attachment, “xxx.pdf”)

I got error— “Activity type 'VisualBasciValue ‘1’ requires compilation in order to run. Please ensure that the workflow has been”

Please help me anyone for this.

Regards,
Raja G

@Raja.G

As per error your inverted comma might be wrong …please check the same

Also its contains and not contain

Cheers

HI @Anil_G ,

Tried same error coming

@Raja.G

Can you please ahow a screenshot of your filter

Also I doubt if we can filter on attachment name directly

Cheers

Hi @Anil_G ,

I am using Get email activity i pass to Query below

"hasattachment eq true and contain(attachment, “xxx.pdf”)

This query store one variable and pass to the Query option

@Raja.G

Inside contains use single quote around name

Cheers

Hi,

I am using below,

Variable = “xxx.pdf”

"hasattachment eq true and contain(attachment, ‘“+Variable+”’)

Not working

@Raja.G

Contains and not contain

Also better filter name with linq

emails = emails.Where(Function(email) email.Attachments.Any(Function(att) att.Name.ToLower().Contains("xxx.pdf"))).ToList()

cheers

Hi @Anil_G ,

What is variable type of “email”.

Hi @lrtetala ,

Please provide the Variable of “email”.

Regards,
Raja G

Hi @Raja.G

Can you try this

Variable = "xxx.pdf"
emails = emails.Where(Function(email) email.Attachments.Any(Function(att) att.Name.ToLower().Contains(Variable.ToLower()))).ToList()

Regards,

@Raja.G

Email is a function variable need not be declared

Emails is a list of office365mails

Cheers

Hi @lrtetala ,

I am not sure how i can add “emails” what variabletype, i didnt get emails in property type as well

@Raja.G

Emails is the output of get mails activity

Cheers