I am new to SharePoint. I'm creating a workflow in SharePoint 2013 in which I want to iterate a List using a loop.
How to perform looping through list items in SharePoint 2013 Designer Workflows?
How to perform Looping Through List Items in SharePoint 2013 Designer Workflows
sharepointsharepoint-designersharepoint-workflow
Best Answer
I'm not aware that there's any out-of-box way to get a workflow to "loop through" all entries in a list, but you can try to make two workflows bouncing back to each other until all entries are updated, here is the detailed steps,
assuming that the list that we are working on is named
list_work
, in this list, create a column named e.g.cargo
define another list, name it e.g.
list_control
,listID
,cargo
,cargo
to a value.define a workflow, name it e.g.
workflow_list_control
, which is triggered every time the entry inlist_control
is updated, and in this workflow,list_work
where thelist_work.cargo
doesn't equallist_control.cargo
list_work
and set thelist_work.cargo
withlist_control.cargo
, in order to trigger theworkflow_list_work
(see #4 below)define the workflow that needs to be run on the
list_work
, e.g. namedworkflow_list_work
, make it's triggered every time the entry inlist_work
is updated, and in this workflow, make sure it updates the only entry in thelist_control
with the ID of the entry fromlist_work
that is being modified, only to trigger theworkflow_list_control
. In this step, try to put a workflow step to wait and verify the ID is properly updated, in order to allow enough time for the previousworkflow_list_control
properly finishes.Every time if a looping-through is necessary, modify the entry in
list_control
with a different value in thecargo
field.Also refer to calculated-column-to-retrieve-total-number-of-id