What I need is for the WF to send an email only when all the documents have the column 'Run' set to yes or else don't send an email. The issue I am having is that it only runs on a one item. I need it to go through each item to verify that it meets the criteria before sending an email out. What am I doing wrong?
You could create a site workflow to loop through the documents in the list and check the "Run" field of each document; the problem is that site workflows can only be run manually.
From you question I presume that you want an automatic process. In this scenario you can:
- create a SharePoint 2013 workflow on the list that starts when a document is uploaded or changed
- use the call web service action and SharePoint REST APIs to retrieve all documents in the library
- loop through the documents and check the Run field of each document.
- If all documents including the current document have Run = Yes, then you send the email.
I hope this helps. I may be able to give you more instructions on how to do this tomorrow if needed.
My suggestion is create a custom timer job. This will execute each time you want (like 15 minutes, 9:00 AM ... ). In this timer job, we will add condition to check all of the documents have "Yes" on Run column or not. If true we will send email to specific manager, if false we do nothing.