2

I need to create a workflow which sends an email to a specific manager. I created a WF with the following... test workflow

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?

2

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.

  • If you could tomorrow, that would be excellent. I really appreciate it. – John Dec 18 '15 at 0:17
  • Mihail, can you send me the instructions please? – John Dec 18 '15 at 17:49
0

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.

  • Which condition would I add to check all of the documents? Is the one, I posted, incorrect? – John Dec 18 '15 at 16:54
  • Yes. I think we will check all of the documents have the "Run" column is Yes or No, if Yes we will send email to manager. – trantab Dec 21 '15 at 1:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.