Easiest way to check your if statements is to add a write line activity for each one. I went through and every time I saw an if statement I add write line: “first if true” or “first if false”, then for the 2nd if I did the same thing: “second if true” or “second if false”.
When I ran it, I followed the 1st false branch, then the 2nd false branch (which throws an error).
Note that I do have outlook open and running, so you may want to check your conditions. I don’t think you’re properly finding the “OUTLOOK” string. Your current line of
Will just show the string “System.Collections.ObjectModel.Collection`1[System.Diagnostics.Process]” so searching if it contains “OUTLOOK” will always be false.
Since you’re saving running processes as a collection, you should first use the “Exists in Collection” activity and search for OUTLOOK. This will output a boolean which you can then use in the first IF statement