Example: Daily Sales Report Workflow using SharePoint
Looping Processor / Looping Timer Workflow Components (Daily Sales Report):
Workflow Control List
2. Initiate Invoice Processing Workflow: (Looping Timer Workflow)
3. Invoice Processing Workflow
Workflow Control List & Workflow Triggers
The Invoice list will need a column/filed to flag if the Invoice has been processed or not. This could be a hidden boolean (true/false) field "Processed" or similar, which would be set to No/false as default when an Invoice is added to the list. The "Processed" field would be used by the Initiate Invoice Processing (2) workflow to find the next Invoice item to be processed. The unprocessed Invoice item found should then be updated by setting "Processed" to yes/true, which will then initiate the Invoice Processor (3) workflow for that Invoice. The final step of the Invoice Processing (2) workflow after initiating the next Invoice Processor workflow in the sequence can be to remove the current item ("Process Next invoice"), as t is no longer required. The final steps of the Invoice Processor (3) workflow should be to create a new item in the Workflow Control list with the title "Process Next Invoice", which will re-initiate the Initiate Invoice Processing (2) workflow creating the looping functionality, then set "Processed" to yes/true.
As the workflow is scheduled to run every 24 hours, items in the Invoices list from previous days will already have been processed by previous instances of the workflows. Only invoices added to the Invoice list since the last time the Report workflows were run, which will be any from the current day.
SharePoint Looping Workflow - How to: Loop through and process all items in a list
To use SharePoint workflows to loop through all items in a list to perform calculations, process and update metadata values, or concatenate the value of a specific column in all list items into a single string.
How to get an SPD Workflow to Run at a Specific Time – Employee Vacation Reminder: Part 5
(Looping) Timer Workflows Using SharePoint
Looping timer workflow (eg. send a daily notification/reminder until a specific condition is met.
How to wait for a change in any list, wait for multiple field changes in the current item (SharePoint Workflow)
This article describes techniques which can be used when developing workflows in SharePoint using SharePoint Designer. They allow a workflow to wait for a field change in an item in another list, or to wait for multiple field changes in the current item before continuing.
SPD Workflow - Test if value exists in any item in SharePoint list - create new item if not found
SharePoint Designer Workflow: How to test if a specific value exists in any item in a list without the workflow stopping due to a "List item not found" error if no items exist with the required value.
SharePoint Workflow Errors: Descriptions, resolutions and WorkaroundsThe following table lists some of the common errors that can occur in a Workflow developed using SharePoint Designer. A short description of some of the likely causes for each error are also provided.