Sorry to be a pain - I have to urgently complete a task by 4pm today and have wasted about 12 hours trying to solve this.
Could you please tell me why I can not find the action mail.subject.contains?
Is there a package that I need to install?
I have tried reinstalling Uipath but I think that it remembers what I have installed before. As the first time I had it available and I must have messed up my configuration.
Sorry for the late reply. I’m a new user so I couldn’t reply anymore until my account was released from its restrictions.
If I’m understanding you correctly, it sounds like you have retrieved a list of mail messages and are looping through them possibly using a For Each activity. The syntax would be similar to For each item in Enter a VB expression.
Mail.Subject.contains is not an action or activity but more of a filter. In this case, if you were to leave the item as default, you could use item.subject.contains rather than mail.subject.contains since item/mail contains the individual record in the list of emails.
To call the function, you could do something like, item.subject.contains(“word to search for”).
I will share with you the sample that I am trying to follow but the activity is not available to select in my installation. I am sure that there is a package that I have not installed.
Problem statement :- I need to identify emails with the subject containing Statements which have attachments.
Download and save the attachments to a folder and then extract the text from the PDF attachments.
I’m not sure if you’re looking for the text “Statements which have attachments” in the subject line or if you are looking for emails with attachments. In any case, you will need theUiPath.System.Activities package listed on the Project tab.
The image above has the “Get Pop3 Mail Messages” activity added to the project panel. The output for the activity (in the project panel is set to MyEmails.
The item variable has to be changed to System.Net.Mail.MailMessage
I’ve added a Write Line Activity to the body of the for each loop.
“item.Subject.Contains(“Welcome”).ToString”
This gives me a boolean (true/false) return value if it finds the text.
Perhaps this will get you a little further than where you were before. Let me know if you need more help and what has worked / not worked when you tried.
I hope all is well. I made a video for you to walk you through retrieving emails and using Mail.subject.contains though I think I used item.subject.contains.
I hope it helps you. Let me know if you need any other walk throughs.