I would like to ask a question " how to apply multiple subject filters in get outlook mail message or for each email?
My requirement is 1. I need to add 15 filters based on subject lines (all the data maintained in an excel file).
2. Bot should be able to read the mail from inbox as per given subject lines and then it will check the subjects in the excel file and if the same subject lines are present in the file then it will raise a ticket on an inhouse tool (as per set parameters).
I have tried this however I did not get the correct solution.
1.read the excel file with that column having all the subjective that needs to be validated using READ RANGE activity and get the output as a datatable named dt
Then convert that one column from datatable as a array of value using this expression in assign activity
Step 1: Read the subject filters from your Excel file into a collection in datatable
Step 2: Use a “For Each” loop through the collection of subject lines obtained from the Excel file.
Step 3: Inside the loop, use the “Get Outlook Mail Message” activity to retrieve emails from your inbox. In the filter options for this activity, use the current subject line as filter from Excel file.
Step 4: For each retrieved email within the loop, you can compare its subject with the subject line. If there’s a match, you can proceed to raise a ticket.
Thank you very much for the solution. It really worked to get multiple subject filters as per the set inputs. However bot is getting failed while comparing between the subject line (which come over Outlook email) and excel file subject lines (which I have mentioned in the sheet) as subject length is not fixed.
For Instances-
Subjects lines which come over outlook email-
1.[External] Event ID : #44987340 | Application Name :PMDL Online check Web16 | Level 1: Error On Contact And Other Details Page : 02-Oct-2023 21:09:39
2.[External] Event ID : #44017654 | Application Name : PMDL New check Application | Level 1: Error On Contact And Other Details Page : 02-Oct-2023 21:09:39
[External] Event ID : #44879425 | Application Name : PMDL_Helpdesk_Verfication_File_Based | Level 1: Error On Contact And Other Details Page : 02-Oct-2023 21:09:39
[External] Event ID : #44873456 | Application Name : NALK Help desk mip 101 298 14 291 APPLICATION | Level 1: Error On Contact And Other Details Page : 02-Oct-2023 21:09:39
Subject lines which I have mentioned in excel sheet-
PMDL Online check Web16
PMDL New check Application
PMDL_Helpdesk_Verfication_File_Based
NALK Help desk mip 101 298 14 291 APPLICATION
I have tried to trim the length still couldn’t get this as length is not same for every subject lines.
I would be thankful to you if I get a solution on it.
Hi @PalaI have tried this arr_subjectlines.Any(Function(a) item.Subject.ToString.Trim(a.ToString.Trim)) however It didn’t work. I am getting below SS error-
I would like to ask one more question on this, After comparison between the outlook mail subject and Input file how will we save that email with that name (which bot will get after comparison ) ?