How to compare Subject line with Attachement Name?

Hi,
how to compare subject line with pdf attachment file name.
how to write expression for that ?

Regards

Hi,

Please try with below expression and let us know. thanks.

item.subject=CType(item.Attachments.FirstOrDefault, Attachment).Name

1 Like

Hi,

Pls try below. thanks

AttachmentName = CType(item.Attachments.FirstOrDefault, Attachment).Name

Number = item.subject.split("/β€œc)(0).replace(”[EXT] β€œ,”")
Code = item.subject.split("/"c)(2)

SubjectFInal = Number+Code

if(SubjectFInal = AttachmentName)

Hi @kirankumar.mahanthi1
this expression is not working
every time subject line changes with attachments.

Regards

mm there is no fixed subject i guess. if we get multiple attachments in that case how many codes we would get in subject.

Hi @kirankumar.mahanthi1
can you make this using activities in uipath ?

Not fixed codes(attachements).

subject line compares with only pdf file format

A rough shot, only checking the number part could look like this:

grafik

(From x In myMail.Attachments.Where(Function (x) x.Name.toUpper.EndsWith(".PDF"))
Let srx = Regex.Match(myMail.Subject,"\d+")
Let nrx = Regex.Match(x.Name,"\d+")
Where {srx.Success,nrx.Success}.All(Function (c1) c1)
Where srx.Value.Equals(nrx.Value)).Count > 0
  • filtering out all attachments, taking only pdfs
  • extract the number from subject and attachment name
  • continue when both regexes did succeed
  • check if both numbers are matching

ensure System.Text.RegularExpressions is added to the imports (close to the variable panel)

we can adopt or change to:

  • incorporating also to check the CN, BL, XXX Tokens
  • Filtering out the relevant / matching Attachment Filenames
    …
1 Like

As per your requirement and samples i have created sample work flow. please have a look if it suits your requirement. thanks.

Attachment Demo.zip (3.1 KB)

Hi,

i did not see any error in work flow related to that. Could you pls check the work flow. Updated work flow with filter.

AttachmentDemoUpdated.zip (3.3 KB)

Hi @kirankumar.mahanthi1
the bot doesn’t show results.
18

the attachments are not downloaded after matching subject line items

Hi,

i think some where the condition is not matching i guess. if possible could you pls share your work flow. thanks.

i have used option to check only one latest email. pls check and increase the number of emails to review if you want.

Hi @kirankumar.mahanthi1
Please help me to download attachments

Regards

Hi,

Updated work flow and try to run and see are you able to get your PDF. thanks.

TM_CR1 Updated.zip (790.5 KB)

2 Likes

hi,
no PDF files downloaded

Hi,

Send me your sample email subject and PDF names you are trying so that i have to replicate at my end see then only i will be able to help you. For my example it is working fine. thanks.