I need to filter mails based on mail address : abc@gmail.com and subject will be like “Balance confirmation”.
Try this in Filter Property of Get Outlook Mail Messages
"[SenderEmailAddress] = 'abc@gmail.com' AND [Subject] = 'Balance confirmation'"
Regards
Hi subject will be having balance confirmation 55553 .The numbers will be changing
Try this:
"[SenderEmailAddress] = 'abc@gmail.com' AND [Subject] LIKE 'Balance confirmation %'"
Regards
It is not working. It is showing condition is not valid
=> Use Get Outlook Mail Messages and store the output in a variable say MailMessages
.
=> Use the below syntax in Assign activity:
MailMessages = MailMessages.Where(Function(mail) mail.SenderEmailAddress.Equals("abc@gmail.com") And mail.Subject.ToString.Contains("Balance confirmation")).ToList()
=> Use For Each loop to iterate through MailMessages
variable and continue with further process.
Note: Please remove the filter condition in properties panel of Get Outlook Mail Messages.
Regards
Hi @sathish_moorthy ,
- Use this filter in the subject line.
"@SQL=(" "urn:schemas:httpmail:subject" "LIKE '%Balance confirmation%')"
- Take assign activity to filter the mails based on email id,
Listofmail as Arrayof(MailMessage)
(From m In Mailmsg
Where m.Sender.Address.Trim().Equals("attendance@predoole.com")
Select m).ToArray()
- For each activity, iterate from Listofmail.
Regards,
Vinit Mhatre
- Get Outlook Mail Messages: Drag an “Get Outlook Mail Messages” activity onto your UiPath workflow. Configure it to connect to your Outlook account and retrieve emails.
- Loop Through Emails: Use a “For Each” loop activity to iterate through each email retrieved.
- Filtering by Sender: Inside the loop, use an “If” activity to check if the sender’s email address matches the desired address (e.g., “abc@gmail.com”). You can use the
item.From.Address
property to get the sender’s email address. - Filtering by Subject: Within the same “If” activity, add a condition to check if the subject contains the desired phrase (e.g., “Balance confirmation”). You can use the
item.Subject.Contains("Balance confirmation")
condition. - Perform Actions on Matching Emails: If both conditions are met, perform the desired actions, such as saving the email attachment, marking the email as read, moving it to a specific folder, or extracting information from the email body.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.