facebook google plus twitter
Webucator's Free SharePoint Power User Training Tutorial

Lesson: Creating Custom Workflows with SharePoint Designer 2013

Welcome to our free SharePoint Power User Training tutorial. This tutorial is based on Webucator's SharePoint 2016 Power User Training course.

In this lesson, you will learn how to create custom workflows with SharePoint Designer 2013. Microsoft did not create a 2016 version of SharePoint Designer, but SharePoint Designer 2013 is fully supported to work with SharePoint 2016.

Lesson Goals

  • Learn about workflow basics.
  • Learn how to create a List Workflow using SharePoint Designer 2013.
  • Learn how to run a workflow.
  • Learn how to view a workflow's history.
  • Learn how to add Actions to a workflow.
  • Learn how to add Conditions to a workflow.
  • Learn how to add parameters to a workflow initiation form.
  • Learn how to create a Site workflow.
  • Learn how to use a Looping container in a Workflow.
  • Learn how to use an Call HTTP Web Service Action

Workflow Basics

Workflows are a popular way to perform automated work in SharePoint. Any type of automation you require from SharePoint, whether it be approving items or notifications with email, a workflow is the most common way to get it done. SharePoint 2016 comes with extra out-of-box workflows that can be associated and configured with lists and libraries using just the browser. Custom workflows can be created with software applications such as SharePoint Designer 2013 or Visual Studio.

SharePoint Designer is a powerful and fairly easy-to-use tool for creating custom workflows and does not require any formal developer skills. Visual Studio, although extremely powerful in creating custom workflows, requires developer skills to use.

SharePoint 2016 supports two different processing engines for workflows. There is the SharePoint 2010 workflow engine that runs in-process on SharePoint servers and is supported mainly for backwards compatibility with earlier versions. The second workflow engine runs outside the SharePoint processes in a separate Workflow Manager process. Workflow Manager has to be installed and configured separate from the SharePoint installation and then connected to SharePoint. These newer workflows are referred to as "SharePoint 2013 Workflows". When using SharePoint Designer 2013, if the Workflow Manager has been provisioned, you will see two choices when creating a new workflow that represent the two different engines.SharePoint Designer workflow paltform choices

The walk-throughs and exercises in this course will focus on using SharePoint Designer 2013 to create SharePoint 2013 Workflows. Microsoft did not create a 2016 version of SharePoint Designer but they fully support using SharePoint Designer 2013 to work with SharePoint 2016.

Creating custom workflows is a deep topic with lots of options. The intent of this chapter is to introduce the basics and is not intended as a thorough deep dive into the subject.

Custom List Workflows

SharePoint Designer 2013 is a perfect tool for creating custom workflows for lists and libraries. When you create a list workflow, it is associated with a specific list or library at creation time and has access to any metadata of the item the workflow is run against.

The following walk-through will show you how to create a very basic custom list with a couple of custom columns. Once the list is created the walk-through shows how to use SharePoint Designer 2013 to create an associated custom workflow with the list. Later walk-throughs will build upon the workflow created in this walk-through.

  1. Create a new custom list in your site named "Workflow Demo".
    1. Click the Settings menu and choose the Add an app item.
    2. Select Custom List from the template choices and type "Workflow Demo" in the Name field.
    3. Click the Create button to complete creating the list.
  2. Add a choice column named "Colors" and a text column named "Workflow Output" to Workflow Demo list.
    1. Click the Create Column link on the LIST tab toolbar.
    2. Type "Colors" in the Column name field and select Choice for the data type option.
    3. Enter "Red", "Blue", and "Green" on separate lines in the choices field within the Additional Column Settings area.
    4. Click the OK button to complete creating the column.
    5. Click the Create Column link on the LIST tab toolbar.
    6. Type "Workflow Output" in the Column name text-box field.
    7. Click the OK button to create the column.
  3. Launch SharePoint Designer 2013 and create a List Workflow associated with the Workflow Demo list.
    1. Open SharePoint Designer 2013 and then open your team site in Designer.
    2. On the Site tab toolbar, click the List Workflow drop-down button and choose the Workflow Demo list. Custom Workflows
    3. Type "Workflow Demo-WF" in the Name field and make sure SharePoint 2013 Workflow is selected in the Platform Type drop-down list of the Create List Workflow dialog and click the OK button. Custom Workflows
  4. Leave the workflow open in SharePoint Designer for the next walk-through.

Workflow Actions

Workflow Actions are the main working component in a SharePoint Designer workflow. SharePoint Designer is limited to being able only to do things that are defined in an Action. However, SharePoint comes with a wide range of Actions out-of-box. The following is a grouped list of Actions available in a default installation of SharePoint Server 2016 for the SharePoint 2013 Workflow platform (The SharePoint 2010 Workflow platform has similar but different list of actions):

  • Coordination Actions Coordination actions
  • Core Actions Core actions
  • List Actions List actions
  • Task Actions Task actions
  • Utility Actions Utility actions

Additional Actions can be purchased, downloaded for free, or created by in-house developers and installed in SharePoint and then configured with SharePoint Designer just like out-of-the-box actions.

SharePoint Designer workflows are created by combining as many Actions as necessary to get the job done.

The following walk-through will show you how to add and configure a couple of actions to the workflow that was created in the previous walk-through.

  1. Add a Log to History List action to the Workflow Demo-WF.
    1. Click the Action drop-down button from the Workflow tab toolbar and select the Log to History List action. Workflow Actions
    2. Click the message link inside the Log to History List action added from the previous step. Workflow Actions
    3. Type "Hello from workflow" inside the text box field. Workflow Actions
    4. Hover and click the orange bar below the Log to History List action. Workflow Actions
    5. Type "Set Field" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Set Field in Current Item action. Workflow Actions

      This is just another way to add an action to a workflow. You could also use the Workflow tab's Action drop-down button like you did with the Log to History List action.

    6. Click the field link inside the Set Field in Current Item action. Workflow Actions
    7. Choose the Workflow Output field from the drop-down list. Workflow Actions
    8. Click the value link inside the Set Field in Current Item action. Workflow Actions
    9. Type "This field was set by the Workflow Demo-WF" in the value text box.
    10. Hover and click the orange bar below the Transition to stage section of the Workflow Stage container. Workflow Actions
    11. Type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action. Workflow Actions
    12. Click the stage link and choose End of Workflow from the drop-down of the Go to a stage action.Workflow Actions
  2. Click the Publish button in the Workflows tab toolbar to publish the workflow to our SharePoint site. Workflow Actions
  3. Create a new item in the Workflow Demo list and start an instance of the Workflow Demo-WF on it.
    1. Switch back to the browser window and click the Workflow Demo link in the sites Quick Launch menu.
    2. Click the new item link inside the list.
    3. Type "Item One" for the Title field and click the Save button.
    4. Click the ellipsis button to the right of Item One and select Advanced and then Workflows from the drop-down.Workflow Actions
    5. Click the Workflow Demo-WF link on the Workflows page. Workflow Actions
  4. Verify the workflow actions outcome.
    1. Verify the list now has a column titled Workflow Demo-WF and the Item One item's value for the column is Stage 1. Note the value here is the default title of the stage which can be changed.
    2. Verify the Workflow Output column has the text we wrote to it through the workflow. Workflow Actions
    3. Click the Stage 1 link in the Workflow Demo-WF column.
    4. Verify the Workflow History area has the output from our workflow action and the Internal Status field shows Completed. Workflow Actions

Workflow Stages and Conditions

The SharePoint Workflow platform uses stages to group and run actions. SharePoint Designer creates a single stage by default but you can add as many stages to a workflow as necessary. Each stage has a single entry and exit point and can be grouped into a flowchart style design. Condition statements can be used to control the flow from one stage to the next in a workflow.

In addition to conditions that control stage transitions there are additional conditions to control which Actions run or don't run within a workflow stage. Conditions provide workflows with If-Then and Else-If blocks to wrap Actions. SharePoint Designer provides the following conditions for use within custom workflows:

  • Workflow Conditions Workflow conditions

The following walk-through will show you how add stages to a workflow and use Transition to stage conditions based on the list items color value. Each stage will have a simple Log to History List actions with a different message to identify which stage was processed. The stages will be added into the Workflow Demo-WF that was created in the previous walk-through.

  1. Rename the existing stage to "Decision Stage" and create 3 new stages, one for each color choice in the Workflow-Demo's Colors field, and name them accordingly.
    1. Switch back to SharePoint designer and editing view of the Workflow Demo-WF.
    2. Click the Stage 1 text in the top bar of the existing stage in the workflow. This should change the field into an editable field.Workflow Stage 1 title
    3. Type Decision Stage in the editable field and press the Enter key.Workflow stage name
    4. Click the Insert Stage icon in the SharePoint Designer toolbar.Workflow add stage button

      If the Insert Stage button is greyed out, click the title bar of the existing stage to select the whole stage container or click the background behind the stage. If the focus is on something inside an existing stage the Insert Stage option is not available.

    5. Repeat the previous step twice more until you have 3 additional stages to the one you started with. The new stages should have default names Stage 2, Stage 3 and Stage 4.Workflow stage name
    6. Rename the default stage names to Red Stage, Blue Stage and Green Stage.Workflow stage name
  2. Add a Go to stage action to the Transition to stage areas of the newly added stages.
    1. Hover and click the orange bar below the Transition to stage section of the Red Stage container.Workflow transition to stage area
    2. Type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action. Workflow got to stage action
    3. Click the stage link and choose End of Workflow from the drop-down of the Go to a stage action.Workflow End of Workflow action choice
    4. Repeat the previous steps to add a End of Workflow action to both the Blue Stage and Green Stage. The design view of the workflow should look similar to the following image at this point.Workflow End of Workflow action choice
  3. Add a Log to History List action inside each of the color named stages.
    1. Hover and click the orange bar above the Transition to stage section of the Red Stage container.Workflow actions area
    2. Type "Log" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Log to History List action. Workflow Log to History list action
    3. Click the message link and then click the ellipsis button next to the editable field to open a string builder dialog.Workflow Log to History list action
    4. Type "The color of" including a Space after "of" and then click the Add or Change Lookup button below the field.Workflow string builder
    5. Leave the default Data Source set to Current Item and change the Field from source drop-down to Title and click the OK button.Workflow string builder
    6. Type "is Red!" to the end of the string including a Space before "is" and click the OK button.Workflow string builder
    7. Repeat the previous steps to add a Log to History List message to the Blue Stage and Green Stage changing to message to reflect the color of the stage.Workflow string builder
  4. Add conditions to the Transition to stage area if the Decision Stage that route the workflow to the appropriate stage based on the items color value.
    1. Hover over the Go to End of Workflow in the Decision Stage and click the down arrow icon that appears and choose Delete Action from the menu list.Workflow transition to stage action drop-down
    2. Right-click the orange bar that appears when you hover over the now empty Transition to stage area of the Decision Stage and click the if any value equals value option from the menu.Workflow transition to stage action drop-down
    3. Click the first value link in the new If value equals value condition.Workflow transition to stage action drop-down
    4. Click the fx button that appears next to the text field to perform a lookup.Workflow transition to stage action drop-down
    5. Select Colors in the drop-down Field from source field and click the OK button.Workflow transition to stage action drop-down
    6. Click the second value link in the If value equals value condition and choose Red from the drop-down choice list.Workflow transition to stage action drop-down
    7. Click the orange bar inside the If part of the condition and type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action.Workflow transition to stage action drop-down
    8. Click the a stage link and then choose Red Stage in the drop-down list of the Go to a stage action.Workflow transition to stage action drop-down
    9. Right-click the orange bar inside the Else branch of the condition statement and choose If any value equals value from the menu.Workflow transition to stage action drop-down
    10. Set the first value field of the new If current value equals value to the lookup value of Colors.Workflow transition to stage action drop-down
    11. Set the second value field of the new If current value equals value to the drop-down choice of Blue.Workflow transition to stage action drop-down
    12. Click the orange bar inside the If part of the second new condition and type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action.Workflow transition to stage action drop-down
    13. Click the a stage link and then choose Blue Stage in the drop-down list of the new Go to a stage action.Workflow transition to stage action drop-down
    14. Click the orange bar inside the Else part of the second new condition and type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action.Workflow transition to stage action drop-down
    15. Click the a stage link and then choose Green Stage in the drop-down list of the new Go to a stage action.Workflow transition to stage action drop-down
  5. Click the Publish link in the Workflow tab toolbar to update the SharePoint site with the current changes.
  6. Test the condition branches in the Workflow Demo list.
    1. Switch back to the browser window and click the Workflow Demo link in the sites Quick Launch menu.
    2. Click the Workflows link from the item menu Advanced sub-menu of Item One.Workflow transition to stage action drop-down
    3. Click the Workflow Demo-WF link under the Start a New Workflow heading.
    4. Refresh the Workflow Demo list and click the Red Stage link in the Workflow Demo-WF column for Item One.

      You might have to refresh the list a couple of times before the workflow column shows a link to Red Stage. SharePoint Workflows use a timer job to keep in-sync with the Workflow Manager service and it sometimes takes a few minutes for even a simple workflow to complete

    5. Verify the Workflow History has an entry with a message appropriate for the items Colors field. Workflow Conditions

Workflow Initiation Form

Initiation forms can be used with a SharePoint workflow to pass additional information into the workflow from the user who starts it. SharePoint Designer 2013 offers a wizard-driven interface for creating parameters and generating the Initiation form. The web form that SharePoint Designer creates can be further customized.

One drawback to using Initiation form parameters is that they work only if the workflow is manually started on an item. If a workflow is set to automatically start when an item is modified or created, then there is no opportunity for the user to interact with the Initiation form. The following shows the workflow settings and configuration tab in SharePoint designer with the Start Options and Initiation form outlined: Workflow Initiation Form

The following walk-through will show you how to add an Initiation parameter to the Workflow Demo-WF created in the previous walk-throughs in this lesson.

  1. Add Single line of text parameter named "Input Data" to the Workflow Demo-WF using SharePoint Designer.
    1. Switch back to SharePoint Designer and the editor view of our Workflow Demo-WF workflow.
    2. Click the Initiation Form Parameters button on the Workflow tab toolbar. Workflow Initiation Form
    3. Click the Add... button on the Association and Initiation Form Parameters dialog window. Workflow Initiation Form
    4. Type "Input Data" in the Field name field of the Add Field dialog window. Workflow Initiation Form
    5. Click the Next button.
    6. Click the Finish button.
    7. Click the OK button on the Association and Initiation Form Parameters dialog window.
  2. Modify the Set Field in Current Item workflow action to write the parameter information from the Initiation form into the Workflow Output field of the list item.
    1. Click the This field was set by the Workflow De... link of the Set Field in Current Item action. Workflow Initiation Form
    2. Click the fx button next to the text box to open the Lookup for Single line of text dialog window. Workflow Initiation Form
    3. Click the Data source drop-down and select the Workflow Variables and Parameters option. Workflow Initiation Form
    4. Click the Field from source drop-down and select Parameter: Input Data option. Workflow Initiation Form
    5. Click the OK button to save the settings.
  3. Click the Publish button to save the workflow changes back to the SharePoint server.
  4. Run the Workflow Demo-WF to test the Initiation form parameter.
    1. Switch back to the browser window and click the Workflow Demo link in the site's Quick Launch menu.
    2. Click the Workflows link under the Advanced sub-menu of the item menu of Item One.
    3. Click the Workflow Demo-WF link under the Start a New Workflow heading.
    4. Type "Hello from the initiation form!" in the Input Data field of the Initiation form. Workflow Initiation Form
    5. Click the Start button to start the workflow.
    6. Click the Workflow Demo link in the Quick Launch to refresh the view of the list.
    7. Verify the Workflow Output field for Item One has the text from the Initiation form. Workflow Initiation Form

Site Workflows

Site Workflows are not associated with any particular list or library but are associated with the whole site. These type of workflows can be useful if you want to perform actions across multiple lists or libraries. To access a Site Workflow associated with a site you do so through the SITE WORKFLOWS link on the Site Contents page.Site contents page with site workflows circled

The following walk-through shows how to use SharePoint Designer to create a Site Workflow for the Contoso Team Site. In addition to showcasing a Site Workflow this walk-through will also show how to use looping container as well as a Call to HTTP Web Service action. The Call to HTTP Web Service action is very useful and can be used in any workflow where you want to access SharePoint items other than the one the workflow was started from. Since this example uses a Site Workflow we'll be making a call to an existing SharePoint list to enumerate the items within it.

  1. Add two new items to the Workflow Demo list so that we'll have multiple items to loop through.
    1. Click the Workflow Demo link in the site's Quick Launch menu.
    2. Click the new item link in the Workflow Demo list.
    3. Enter "Item Two" in the Title field and click the Save button.
    4. Repeat the previous steps to add an "Item Three", the list should look similar to the following image:Workflow demo list contents
  2. Create a new Site Workflow for the Contoso Home Site..
    1. In SharePoint Designer 2013 click the Workflows link in the Navigation panel.SharePoint Designer workflows navigation link
    2. Click the Site Workflow button in the toolbar.SharePoint Designer site workflow link
    3. Enter Looping Site Workflow for the Name field, leave the Platform Type set to SharePoint 2013 Workflow and click the OK button.SharePoint Designer create workflow dialog
  3. Create a Call HTTP Service action that connects to the Contoso Home Site and the Workflow Demo list.
    1. Click the orange bar inside the stage, above the Transition to stage, and type the word "call" and then press Enter to insert a Call HTTP Web Service action.Add action
    2. Click the this link at the beginning of the new Call HTTP Service action.Call HTTP web service
    3. Enter http://spserver2016/sites/student/_api/web/lists/getbytitle('Workflow Demo')/items in the Enter the HTTP web service URL field of the dialog and click the OK button.Add action

      The URL entered in this step is using the REST interface provided with SharePoint. Through the SharePoint REST interface you can access any list or library and access the items within. Additional REST commands can be used to filter, sort or even update items. This example simply retrieves all of the items in the Workflow Demo list. Full coverage of the REST based interface is outside the scope of this course.

    4. Click the response link within the Call HTTP Web Service action and choose Create a new variable... from the drop-down.Add action
    5. Type "responseContent" the Name field of the Edit Variable dialog, leave the Type set to the default of Dictionary and click the OK button.Add action

      Variables are used inside of SharePoint Workflows to store information that can be retrieved later in the workflow. In this case the responseContent variable will hold the list items retrieved from the REST call to SharePoint. The Dictionary type allows the variable to store multiple items that can be retrieved through an index or a key.

    6. Click the orange bar above the Call HTTP Web Service action and type the word "build" and press Enter to insert a Build Dictionary action.Add action

      You are adding this dictionary variable to pass needed formatting information into the Call HTTP Web Server action. That is the reason it is being added before the Call HTTP Web Service action.

    7. Click the Variable:dictionary drop-down and choose Create a new variable... from the options.Add action
    8. Type "requestHeaders" in the Name field of the Edit Variable dialog and click the OK button.Add action
    9. Click the this link in the Build Dictionary action.Add action
    10. Click the Add... button in the Build a Dictionary dialog.Add action
    11. Type Accept in the Name field and application/json;odata=verbose in the Value field and click the OK button.Add action

      This is one of two parameters that will be passed into the Call HTTP Web Service to configure the REST call to respond with a JSON formatted response. This will make it easier to get to the results in a later stage of the workflow.

    12. Click the Add... button again to add a second item to the dictionary variable.
    13. Type Content-Type in the Name field and application/json;odata=verbose in the Value field and click the OK button.Add action

      This is the second parameter that will be passed into the Call HTTP Web Service to configure the REST call to respond with a JSON formatted response. This will make it easier to get to the results in a later stage of the workflow.

    14. Click the OK button to save and close the Build a Dictionary dialog.Add action
    15. Hover over the right-hand edge of the Call HTTP Web Service action and click the down arrow button and choose Properties... from the drop-down menu.Add action
    16. Set the RequestHeaders fields drop-down value to the Variable: requestHeaders variable created in the previous steps and click the OK button.Add action
  4. Add a new stage named Loop List Items to the workflow.
    1. Right-click the orange bar below the current Send HTTP Request stage and click the Stage option from the menu.Add action
    2. Click the Stage 2 title and type "Loop List Items" in the editable text box to appears and press Enter.Add action
    3. Right-click the orange bar in the Transition to stage area of the original Send HTTP Request stage and choose the Go to a stage option from the drop-down.Add action
    4. Click the a stage link in the new Go to a stage action and choose Loop List Items from the drop-down menu.Add action
    5. Right-click the orange bar in the Transition to stage area of the new Loop List Items stage and choose the Go to a stage option from the drop-down.
    6. Click the a stage link in the new Go to a stage action and choose End of Workflow from the drop-down menu.Add action
  5. Add a Get an Item from a Dictionary action to retrieve the results of the Call HTTP Web Service action and create variables that will be used for looping.
    1. Click the orange bar inside the Loop List Items stage and type "get" and press Enter to add the Get an Item from a Dictionary Action.Add action
    2. Click the item by name or path link in the new Get an Item from a Dictionary action and type d/results in the text box.Add action

      The string d/results is the path to the list items returned in JSON format from the REST call of the Call HTTP Web Service action.

    3. Click the dictionary link in the Get an Item from a Dictionary action and choose the Variable: responseContent from the drop-down list.Add action
    4. Click the item link in the Get an Item from a Dictionary action and choose Create a new variable... from the drop-down list.Add action
    5. Set the Name field to "listItems" and the Type field drop-down to Dictionary and click the OK button.Add action
    6. Click the orange bar below the Get an Item from a Dictionary action and type "count" and press Enter to insert a Count Items in a Dictionary action into the workflow.Add action
    7. Click the dictionary link in the new Count Items in a Dictionary link and choose Variable: listItems from the drop-down.Add action

      The variable listItems is a dictionary type variable that, at this point in the workflow, should contain the items retrieved from the SharePoint list. Note that the Count Items in a Dictionary action creates an output integer type variable named count. We'll use the count variable to limit the iterations in a looping action that will be added in a later step.

    8. Click the orange bar below the Count Items in a Dictionary action and type "set" and press Enter, choose Set Workflow Variable from the list of choices.Add action
    9. Click the workflow variable link in the new Set Workflow Variable action and choose Create a new variable... from the list of options.Add action
    10. Type "index" in the Name field and choose Integer in the Type drop-down and click the OK button.Add action
    11. Click the value link in the Set Workflow Variable action and type the number "0" in the text field and press Enter.Add action

      The index variable will be used to access the individual items in the listItems dictionary during the loop. A separate action will be added later in the workflow to increment the index variable so that it can point to the next item in the dictionary. SharePoint dictionary items start with an index of 0 so by setting the variable to 0 you can access the first item with the variable.

  6. Add a Loop n Times container to the workflow that loops through the Workflow Demo list items and uses a Log to History List action to write the Title field of the list item as output.
    1. Click the orange bar below the Set Workflow Variable action and type "loop" and press Enter, then choose the Loop n Times option from the drop-down.Add loop
    2. Click the title bar of the new Loop n Times container and type "Loop List Items" and press Enter to rename it.Add action

      Renaming the Loop container is optional but it does make the workflow more readable.

    3. Click the 1 link inside the Loop n Times container.Add action
    4. Click the 1 link and then click the fx link inside the LoopNTime Properties dialog.Add action
    5. Select Workflow Variables and Parameters in the Data source field and select Variable: count in the Field from source field and click the OK button on the Lookup for Integer dialog.Add action
    6. Click the OK button on the LoopNTimes Properties dialog.

      This sets the iterations of the loop to the number of items in the list.

    7. Click the orange bar below the line you set in the previous step and type the word "get" and press Enter to insert a new Get an Item from a Dictionary action.Add action
    8. Click the item by name or path link in the new Get an Item from a Dictionary action.Add action
    9. Click the ellipsis button next to the item by name or path text field to open a string builder dialog.Add action
    10. In the String Builder dialog type a left ( and then click the Add or Change Lookup button.Add action
    11. In the Lookup for String dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: index and click the OK button.Add action
    12. Type a right ) after the newly inserted variable lookup and click the OK button to save the string and close the String Builder dialog.Add action

      You have to have parentheses around the index number that will be used to select a specific list item from the list. Later steps will increment the index for the next iteration of the loop.

    13. Click the dictionary link in the Get an Item from a Dictionary action and select Variable: listItems from the drop-down list.Add action
    14. Click the variable link at the end of the Get an Item from a Dictionary action and choose Create a new variable... from the drop-down list.Add action
    15. In the Edit Variable dialog type item in the Name field and select Dictionary in the Type field and click the OK button.Add action

      The item variable will store the current list item during each iteration of the loop.

    16. Click the orange bar below the last Get an Item from a Dictionary action and type "get" and press Enter to add another Get an Item from a Dictionary action.Add action
    17. Click the item by name or path link in the new Get an Item from a Dictionary action and type Title in the text box and press Enter.Add action

      For the lookup field we are entering the SharePoint column name that has the data you want in the list item. For this example we are using the Title column but we could replace that with any column we want from the list or library.

    18. Click the dictionary link in the Get an Item from a Dictionary action and select Variable: Item from the drop-down list.Add action
    19. Click the variable link at the end of the Get an Item from a Dictionary action and choose Create a new variable... from the drop-down list.Add action
    20. In the Edit Variable dialog type itemTitle in the Name field and select String in the Type field and click the OK button.Add action

      The itemTitle variable will store the current list item's Title that we will write to the Workflow History List in next action.

    21. Click the orange bar below the last Get an Item from a Dictionary action and type "log" and press Enter to insert a Log to History List action.Add action
    22. Click the message link in the new Log to History List action and then click the fx button that appears.Add action
    23. In the Lookup for String dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: itemTitle and click the OK button.Add action
    24. Click the orange bar below the last Log to History List action and type "calc" and press Enter to insert a Do Calculation action.Add action
    25. Click the value link in the new Do Calculation action and then click the fx button that appears.Add action
    26. In the Lookup for Number dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: index and click the OK button.Add action
    27. Click the value link in the Do Calculation action and enter the number 1 in the field.Add action

      The output variable from this action will be used in the next action to increment the index for the next iteration in the loop.

    28. Click the orange bar below the last Do Calculation action and type "set" and press Enter and then choose Set Workflow Variable from the drop-down list to insert a Set Workflow Variable action.Add action
    29. Click the workflow variable link in the Do Calculation action and choose Variable: index from the drop-down list.Add action
    30. Click the value link in the Do Calculation action and then click the fx button that appears.Add action
    31. In the Lookup for Integer dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: calc and click the OK button.Add action
  7. Insert a Set Workflow Status status action after the loop container to notify when the workflow is done with the loop.
    1. Click the orange bar directly below but outside the Loop List Items container.Add action
    2. Type "set" and press Enter then choose Set Workflow Status from the drop-down list.Add action
    3. Click the this message link and type Done! in the text box field and press Enter.Add action

      Setting the Workflow status is optional but it is a useful way to output where the Workflow is in processing actions.

  8. Click the Publish button in the Workflow tab toolbar to save and publish the new workflow to SharePoint.
  9. Run the Looping Site Workflow from the Contoso Home Site and verify that it loops and records the list items correctly.
    1. Switch to the browser window and click the Site Contents link in the Quick Launch menu.
    2. Click the SITE WORKFLOWS link at the top of the page.Add action
    3. Click the Looping Site Workflow link under the Start a New Workflow heading.Add action
    4. Keep refreshing the page until the workflow shows under My Completed Workflows with a Status column reading Done!.Add action
    5. Click the Done! link to navigate to the page that displays the Workflow History.
    6. Verify the Workflow History has an entry for each item in the Workflow Demo list displaying the Title field value.Add action
  10. Close SharePoint Designer 2013.

Creating Custom List Workflows

Duration: 45 to 60 minutes.
  1. Create a new custom list in your site named "Workflow Demo".
    1. Click the Settings menu and choose the Add an app item.
    2. Select Custom List from the template choices and type "Workflow Demo" in the Name field.
    3. Click the Create button to complete creating the list.
  2. Add a choice column named "Colors" and a text column named "Workflow Output" to Workflow Demo list.
    1. Click the Create Column link on the LIST tab toolbar.
    2. Type "Colors" in the Column name field and select Choice for the data type option.
    3. Enter "Red", "Blue", and "Green" on separate lines in the choices field within the Additional Column Settings area.
    4. Click the OK button to complete creating the column.
    5. Click the Create Column link on the LIST tab toolbar.
    6. Type "Workflow Output" in the Column name text-box field.
    7. Click the OK button to create the column.
  3. Add a Log to History List action to the Workflow Demo-WF.
    1. Click the Action drop-down button from the Workflow tab toolbar and select the Log to History List action. Workflow Actions
    2. Click the message link inside the Log to History List action added from the previous step. Workflow Actions
    3. Type "Hello from workflow" inside the text box field. Workflow Actions
    4. Hover and click the orange bar below the Log to History List action. Workflow Actions
    5. Type "Set Field" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Set Field in Current Item action. Workflow Actions

      This is just another way to add an action to a workflow. You could also use the Workflow tab's Action drop-down button like you did with the Log to History List action.

    6. Click the field link inside the Set Field in Current Item action. Workflow Actions
    7. Choose the Workflow Output field from the drop-down list. Workflow Actions
    8. Click the value link inside the Set Field in Current Item action. Workflow Actions
    9. Type "This field was set by the Workflow Demo-WF" in the value text box.
    10. Hover and click the orange bar below the Transition to stage section of the Workflow Stage container. Workflow Actions
    11. Type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action. Workflow Actions
    12. Click the stage link and choose End of Workflow from the drop-down of the Go to a stage action.Workflow Actions
  4. Click the Publish button in the Workflows tab toolbar to publish the workflow to our SharePoint site. Workflow Actions
  5. Create a new item in the Workflow Demo list and start an instance of the Workflow Demo-WF on it.
    1. Switch back to the browser window and click the Workflow Demo link in the sites Quick Launch menu.
    2. Click the new item link inside the list.
    3. Type "Item One" for the Title field and click the Save button.
    4. Click the ellipsis button to the right of Item One and select Advanced and then Workflows from the drop-down.Workflow Actions
    5. Click the Workflow Demo-WF link on the Workflows page. Workflow Actions
  6. Verify the workflow actions outcome.
    1. Verify the list now has a column titled Workflow Demo-WF and the Item One item's value for the column is Stage 1. Note the value here is the default title of the stage which can be changed.
    2. Verify the Workflow Output column has the text we wrote to it through the workflow. Workflow Actions
    3. Click the Stage 1 link in the Workflow Demo-WF column.
    4. Verify the Workflow History area has the output from our workflow action and the Internal Status field shows Completed. Workflow Actions
  7. Rename the existing stage to "Decision Stage" and create 3 new stages, one for each color choice in the Workflow-Demo's Colors field, and name them accordingly.
    1. Switch back to SharePoint designer and editing view of the Workflow Demo-WF.
    2. Click the Stage 1 text in the top bar of the existing stage in the workflow. This should change the field into an editable field.Workflow Stage 1 title
    3. Type Decision Stage in the editable field and press the Enter key.Workflow stage name
    4. Click the Insert Stage icon in the SharePoint Designer toolbar.Workflow add stage button

      If the Insert Stage button is greyed out, click the title bar of the existing stage to select the whole stage container or click the background behind the stage. If the focus is on something inside an existing stage the Insert Stage option is not available.

    5. Repeat the previous step twice more until you have 3 additional stages to the one you started with. The new stages should have default names Stage 2, Stage 3 and Stage 4.Workflow stage name
    6. Rename the default stage names to Red Stage, Blue Stage and Green Stage.Workflow stage name
  8. Add a Go to stage action to the Transition to stage areas of the newly added stages.
    1. Hover and click the orange bar below the Transition to stage section of the Red Stage container.Workflow transition to stage area
    2. Type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action. Workflow got to stage action
    3. Click the stage link and choose End of Workflow from the drop-down of the Go to a stage action.Workflow End of Workflow action choice
    4. Repeat the previous steps to add a End of Workflow action to both the Blue Stage and Green Stage. The design view of the workflow should look similar to the following image at this point.Workflow End of Workflow action choice
  9. Add a Log to History List action inside each of the color named stages.
    1. Hover and click the orange bar above the Transition to stage section of the Red Stage container.Workflow actions area
    2. Type "Log" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Log to History List action. Workflow Log to History list action
    3. Click the message link and then click the ellipse button next to the editable field to open a string builder dialog.Workflow Log to History list action
    4. Type "The color of" including a Space after "of" and then click the Add or Change Lookup button below the field.Workflow string builder
    5. Leave the default Data Source set to Current Item and change the Field from source drop-down to Title and click the OK button.Workflow string builder
    6. Type "is Red!" to the end of the string including a Space before "is" and click the OK button.Workflow string builder
    7. Repeat the previous steps to add a Log to History List message to the Blue Stage and Green Stage changing to message to reflect the color of the stage.Workflow string builder
  10. Add conditions to the Transition to stage area if the Decision Stage that route the workflow to the appropriate stage based on the items color value.
    1. Hover over the Go to End of Workflow in the Decision Stage and click the down arrow icon that appears and choose Delete Action from the menu list.Workflow transition to stage action drop-down
    2. Right-click the orange bar that appears when you hover over the now empty Transition to stage area of the Decision Stage and click the if any value equals value option from the menu.Workflow transition to stage action drop-down
    3. Click the first value link in the new If value equals value condition.Workflow transition to stage action drop-down
    4. Click the fx button that appears next to the text field to perform a lookup.Workflow transition to stage action drop-down
    5. Select Colors in the drop-down Field from source field and click the OK button.Workflow transition to stage action drop-down
    6. Click the second value link in the If value equals value condition and choose Red from the drop-down choice list.Workflow transition to stage action drop-down
    7. Click the orange bar inside the If part of the condition and type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action.Workflow transition to stage action drop-down
    8. Click the a stage link and then choose Red Stage in the drop-down list of the Go to a stage action.Workflow transition to stage action drop-down
    9. Right-click the orange bar inside the Else branch of the condition statement and choose If any value equals value from the menu.Workflow transition to stage action drop-down
    10. Set the first value field of the new If current value equals value to the lookup value of Colors.Workflow transition to stage action drop-down
    11. Set the second value field of the new If current value equals value to the drop-down choice of Blue.Workflow transition to stage action drop-down
    12. Click the orange bar inside the If part of the second new condition and type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action.Workflow transition to stage action drop-down
    13. Click the a stage link and then choose Blue Stage in the drop-down list of the new Go to a stage action.Workflow transition to stage action drop-down
    14. Click the orange bar inside the Else part of the second new condition and type "Go" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Go to a stage action.Workflow transition to stage action drop-down
    15. Click the a stage link and then choose Green Stage in the drop-down list of the new Go to a stage action.Workflow transition to stage action drop-down
  11. Click the Publish link in the Workflow tab toolbar to update the SharePoint site with the current changes.
  12. Test the condition branches in the Workflow Demo list.
    1. Switch back to the browser window and click the Workflow Demo link in the sites Quick Launch menu.
    2. Click the Workflows link from the item menu Advanced sub-menu of Item One.Workflow transition to stage action drop-down
    3. Click the Workflow Demo-WF link under the Start a New Workflow heading.
    4. Refresh the Workflow Demo list and click the Red Stage link in the Workflow Demo-WF column for Item One.

      You might have to refresh the list a couple of times before the workflow column shows a link to Red Stage. SharePoint 2013 Workflows use a timer job to keep in-sync with the Workflow Manager service and it sometimes takes a few minutes for even a simple workflow to complete

    5. Verify the Workflow History has an entry with a message appropriate for the items Colors field. Workflow Conditions
  13. Add Single line of text parameter named "Input Data" to the Workflow Demo-WF using SharePoint Designer.
    1. Switch back to SharePoint Designer and the editor view of our Workflow Demo-WF workflow.
    2. Click the Initiation Form Parameters button on the Workflow tab toolbar. Workflow Initiation Form
    3. Click the Add... button on the Association and Initiation Form Parameters dialog window. Workflow Initiation Form
    4. Type "Input Data" in the Field name field of the Add Field dialog window. Workflow Initiation Form
    5. Click the Next button.
    6. Click the Finish button.
    7. Click the OK button on the Association and Initiation Form Parameters dialog window.
  14. Modify the Set Field in Current Item workflow action to write the parameter information from the Initiation form into the Workflow Output field of the list item.
    1. Click the This field was set by the Workflow De... link of the Set Field in Current Item action. Workflow Initiation Form
    2. Click the fx button next to the text box to open the Lookup for Single line of text dialog window. Workflow Initiation Form
    3. Click the Data source drop-down and select the Workflow Variables and Parameters option. Workflow Initiation Form
    4. Click the Field from source drop-down and select Parameter: Input Data option. Workflow Initiation Form
    5. Click the OK button to save the settings.
  15. Click the Publish button to save the workflow changes back to the SharePoint server.
  16. Run the Workflow Demo-WF to test the Initiation form parameter.
    1. Switch back to the browser window and click the Workflow Demo link in the site's Quick Launch menu.
    2. Click the Workflows link under the Advanced sub-menu of the item menu of Item One.
    3. Click the Workflow Demo-WF link under the Start a New Workflow heading.
    4. Type "Hello from the initiation form!" in the Input Data field of the Initiation form. Workflow Initiation Form
    5. Click the Start button to start the workflow.
    6. Click the Workflow Demo link in the Quick Launch to refresh the view of the list.
    7. Verify the Workflow Output field for Item One has the text from the Initiation form. Workflow Initiation Form

Site Workflow with Looping

Duration: 45 to 60 minutes.
  1. Add two new items to the Workflow Demo list so that we'll have multiple items to loop through.
    1. Click the Workflow Demo link in the site's Quick Launch menu.
    2. Click the new item link in the Workflow Demo list.
    3. Enter "Item Two" in the Title field and click the Save button.
    4. Repeat the previous steps to add an "Item Three", the list should look similar to the following image:Workflow demo list contents
  2. Create a new Site Workflow for the Contoso Home Site..
    1. In SharePoint Designer 2013 click the Workflows link in the Navigation panel.SharePoint Designer workflows navigation link
    2. Click the Site Workflow button in the toolbar.SharePoint Designer site workflow link
    3. Enter Looping Site Workflow for the Name field, leave the Platform Type set to SharePoint 2013 Workflow and click the OK button.SharePoint Designer create workflow dialog
  3. Create a Call HTTP Service action that connects to the Contoso Home Site and the Workflow Demo list.
    1. Click the orange bar inside the stage, above the Transition to stage, and type the word "call" and then press Enter to insert a Call HTTP Web Service action.Add action
    2. Click the this link at the beginning of the new Call HTTP Service action.Call HTTP web service
    3. Enter http://spserver2016/sites/student/_api/web/lists/getbytitle('Workflow Demo')/items in the Enter the HTTP web service URL field of the dialog and click the OK button.Add action

      The URL entered in this step is using the REST interface provided with SharePoint. Through the SharePoint REST interface you can access any list or library and access the items within. Additional REST commands can be used to filter, sort or even update items. This example simply retrieves all of the items in the Workflow Demo list. Full coverage of the REST based interface is outside the scope of this course.

    4. Click the response link within the Call HTTP Web Service action and choose Create a new variable... from the drop-down.Add action
    5. Type "responseContent" the Name field of the Edit Variable dialog, leave the Type set to the default of Dictionary and click the OK button.Add action

      Variables are used inside of SharePoint Workflows to store information that can be retrieved later in the workflow. In this case the responseContent variable will hold the list items retrieved from the REST call to SharePoint. The Dictionary type allows the variable to store multiple items that can be retrieved through an index or a key.

    6. Click the orange bar above the Call HTTP Web Service action and type the word "build" and press Enter to insert a Build Dictionary action.Add action

      You are adding this dictionary variable to pass needed formatting information into the Call HTTP Web Server action. That is the reason it is being added before the Call HTTP Web Service action.

    7. Click the Variable:dictionary drop-down and choose Create a new variable... from the options.Add action
    8. Type "requestHeaders" in the Name field of the Edit Variable dialog and click the OK button.Add action
    9. Click the this link in the Build Dictionary action.Add action
    10. Click the Add... button in the Build a Dictionary dialog.Add action
    11. Type Accept in the Name field and application/json;odata=verbose in the Value field and click the OK button.Add action

      This is one of two parameters that will be passed into the Call HTTP Web Service to configure the REST call to respond with a JSON formatted response. This will make it easier to get to the results in a later stage of the workflow.

    12. Click the Add... button again to add a second item to the dictionary variable.
    13. Type Content-Type in the Name field and application/json;odata=verbose in the Value field and click the OK button.Add action

      This is the second parameter that will be passed into the Call HTTP Web Service to configure the REST call to respond with a JSON formatted response. This will make it easier to get to the results in a later stage of the workflow.

    14. Click the OK button to save and close the Build a Dictionary dialog.Add action
    15. Hover over the right-hand edge of the Call HTTP Web Service action and click the down arrow button and choose Properties... from the drop-down menu.Add action
    16. Set the RequestHeaders fields drop-down value to the Variable: requestHeaders variable created in the previous steps and click the OK button.Add action
  4. Add a new stage named Loop List Items to the workflow.
    1. Right-click the orange bar below the current Send HTTP Request stage and click the Stage option from the menu.Add action
    2. Click the Stage 2 title and type "Loop List Items" in the editable text box to appears and press Enter.Add action
    3. Right-click the orange bar in the Transition to stage area of the original Send HTTP Request stage and choose the Go to a stage option from the drop-down.Add action
    4. Click the a stage link in the new Go to a stage action and choose Loop List Items from the drop-down menu.Add action
    5. Right-click the orange bar in the Transition to stage area of the new Loop List Items stage and choose the Go to a stage option from the drop-down.
    6. Click the a stage link in the new Go to a stage action and choose End of Workflow from the drop-down menu.Add action
  5. Add a Get an Item from a Dictionary action to retrieve the results of the Call HTTP Web Service action and create variables that will be used for looping.
    1. Click the orange bar inside the Loop List Items stage and type "get" and press Enter to add the Get an Item from a Dictionary Action.Add action
    2. Click the item by name or path link in the new Get an Item from a Dictionary action and type d/results in the text box.Add action

      The string d/results is the path to the list items returned in JSON format from the REST call of the Call HTTP Web Service action.

    3. Click the dictionary link in the Get an Item from a Dictionary action and choose the Variable: responseContent from the drop-down list.Add action
    4. Click the item link in the Get an Item from a Dictionary action and choose Create a new variable... from the drop-down list.Add action
    5. Set the Name field to "listItems" and the Type field drop-down to Dictionary and click the OK button.Add action
    6. Click the orange bar below the Get an Item from a Dictionary action and type "count" and press Enter to insert a Count Items in a Dictionary action into the workflow.Add action
    7. Click the dictionary link in the new Count Items in a Dictionary link and choose Variable: listItems from the drop-down.Add action

      The variable listItems is a dictionary type variable that, at this point in the workflow, should contain the items retrieved from the SharePoint list. Note that the Count Items in a Dictionary action creates an output integer type variable named count. We'll use the count variable to limit the iterations in a looping action that will be added in a later step.

    8. Click the orange bar below the Count Items in a Dictionary action and type "set" and press Enter, choose Set Workflow Variable from the list of choices.Add action
    9. Click the workflow variable link in the new Set Workflow Variable action and choose Create a new variable... from the list of options.Add action
    10. Type "index" in the Name field and choose Integer in the Type drop-down and click the OK button.Add action
    11. Click the value link in the Set Workflow Variable action and type the number "0" in the text field and press Enter.Add action

      The index variable will be used to access the individual items in the listItems dictionary during the loop. A separate action will be added later in the workflow to increment the index variable so that it can point to the next item in the dictionary. SharePoint dictionary items start with an index of 0 so by setting the variable to 0 you can access the first item with the variable.

  6. Add a Loop n Times container to the workflow that loops through the Workflow Demo list items and uses a Log to History List action to write the Title field of the list item as output.
    1. Click the orange bar below the Set Workflow Variable action and type "loop" and press Enter, then choose the Loop n Times option from the drop-down.Add loop
    2. Click the title bar of the new Loop n Times container and type "Loop List Items" and press Enter to rename it.Add action

      Renaming the Loop container is optional but it does make the workflow more readable.

    3. Click the 1 link inside the Loop n Times container.Add action
    4. Click the 1 link and then click the fx link inside the LoopNTime Properties dialog.Add action
    5. Select Workflow Variables and Parameters in the Data source field and select Variable: count in the Field from source field and click the OK button on the Lookup for Integer dialog.Add action
    6. Click the OK button on the LoopNTimes Properties dialog.

      This sets the iterations of the loop to the number of items in the list.

    7. Click the orange bar below the line you set in the previous step and type the word "get" and press Enter to insert a new Get an Item from a Dictionary action.Add action
    8. Click the item by name or path link in the new Get an Item from a Dictionary action.Add action
    9. Click the ellipse button next to the item by name or path text field to open a string builder dialog.Add action
    10. In the String Builder dialog type a left ( and then click the Add or Change Lookup button.Add action
    11. In the Lookup for String dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: index and click the OK button.Add action
    12. Type a right ) after the newly inserted variable lookup and click the OK button to save the string and close the String Builder dialog.Add action

      You have to have parentheses around the index number that will be used to select a specific list item from the list. Later steps will increment the index for the next iteration of the loop.

    13. Click the dictionary link in the Get an Item from a Dictionary action and select Variable: listItems from the drop-down list.Add action
    14. Click the variable link at the end of the Get an Item from a Dictionary action and choose Create a new variable... from the drop-down list.Add action
    15. In the Edit Variable dialog type item in the Name field and select Dictionary in the Type field and click the OK button.Add action

      The item variable will store the current list item during each iteration of the loop.

    16. Click the orange bar below the last Get an Item from a Dictionary action and type "get" and press Enter to add another Get an Item from a Dictionary action.Add action
    17. Click the item by name or path link in the new Get an Item from a Dictionary action and type Title in the text box and press Enter.Add action

      For the lookup field we are entering the SharePoint column name that has the data you want in the list item. For this example we are using the Title column but we could replace that with any column we want from the list or library.

    18. Click the dictionary link in the Get an Item from a Dictionary action and select Variable: Item from the drop-down list.Add action
    19. Click the variable link at the end of the Get an Item from a Dictionary action and choose Create a new variable... from the drop-down list.Add action
    20. In the Edit Variable dialog type itemTitle in the Name field and select String in the Type field and click the OK button.Add action

      The itemTitle variable will store the current list item's Title that we will write to the Workflow History List in next action.

    21. Click the orange bar below the last Get an Item from a Dictionary action and type "log" and press Enter to insert a Log to History List action.Add action
    22. Click the message link in the new Log to History List action and then click the fx button that appears.Add action
    23. In the Lookup for String dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: itemTitle and click the OK button.Add action
    24. Click the orange bar below the last Log to History List action and type "calc" and press Enter to insert a Do Calculation action.Add action
    25. Click the value link in the new Do Calculation action and then click the fx button that appears.Add action
    26. In the Lookup for Number dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: index and click the OK button.Add action
    27. Click the value link in the Do Calculation action and enter the number 1 in the field.Add action

      The output variable from this action will be used in the next action to increment the index for the next iteration in the loop.

    28. Click the orange bar below the last Do Calculation action and type "set" and press Enter and then choose Set Workflow Variable from the drop-down list to insert a Set Workflow Variable action.Add action
    29. Click the workflow variable link in the Do Calculation action and choose Variable: index from the drop-down list.Add action
    30. Click the value link in the Do Calculation action and then click the fx button that appears.Add action
    31. In the Lookup for Integer dialog set the Data source field to Workflow Variables and Parameters and the Field from source field to Variable: calc and click the OK button.Add action
  7. Insert a Set Workflow Status status action after the loop container to notify when the workflow is done with the loop.
    1. Click the orange bar directly below but outside the Loop List Items container.Add action
    2. Type "set" and press Enter then choose Set Workflow Status from the drop-down list.Add action
    3. Click the this message link and type Done! in the text box field and press Enter.Add action

      Setting the Workflow status is optional but it is a useful way to output where the Workflow is in processing actions.

  8. Click the Publish button in the Workflow tab toolbar to save and publish the new workflow to SharePoint.
  9. Run the Looping Site Workflow from the Contoso Home Site and verify that it loops and records the list items correctly.
    1. Switch to the browser window and click the Site Contents link in the Quick Launch menu.
    2. Click the SITE WORKFLOWS link at the top of the page.Add action
    3. Click the Looping Site Workflow link under the Start a New Workflow heading.Add action
    4. Keep refreshing the page until the workflow shows under My Completed Workflows with a Status column reading Done!.Add action
    5. Click the Done! link to navigate to the page that displays the Workflow History.
    6. Verify the Workflow History has an entry for each item in the Workflow Demo list displaying the Title field value.Add action
  10. Close SharePoint Designer 2013.