Workflow Conditions

Contact Us or call 1-877-932-8228
Workflow Conditions

Workflow Conditions

Workflow conditions are a way to control which Actions run or don't run within a workflow. Conditions provide workflows with If-Then and Else-If blocks to wrap Actions. SharePoint Designer provides the following conditions for use within custom workflows:

  • Common Conditions
    • If any value equals value
    • If current item field equals value
  • Other Conditions
    • Created by specific person
    • Created in a specific date span
    • Modified by a specific person
    • Modified in a specific date span
    • Person is a valid SharePoint user
    • Title field contains keywords

The following walk-through will show you how add a couple If current item field equals value conditions that will run different Log to History List actions based on valued within the Colors column of our Workflow Demo list. The conditions will be added into the Workflow Demo-WF that was created in the previous walk-through.

  1. Add If current item field equals value conditions to check for the different color values within the Colors column of a Workflow Demo list item.
    1. Switch back to SharePoint Designer and the editor view of our Workflow Demo-WF workflow.
    2. Hover and click the orange bar below the last action. Workflow Conditions
    3. Click the Condition drop-down button and choose the If current item field equals value option. Workflow Conditions
    4. Click the field link in the condition and choose the Colors option from the drop-down list. Workflow Conditions
    5. Click the value link and choose the Red option from the drop-down list. Workflow Conditions
    6. Click the Else-If Branch button on the Workflow tab tool bar twice to add two more condition blocks to the workflow. Workflow Conditions
    7. Click the orange bar below the (Insert a condition) label and type "If current" and press the Enter key to have the editor fill in the rest. Workflow Conditions
    8. Click the field link inside the Else if branch and choose the Colors field from the drop-down list. Workflow Conditions
    9. Click the value link and choose the Blue color option from the drop-down list.
  2. Add a Log to History List action inside each of the condition branches.
    1. Click the (Start typing or use the Insert group in the Ribbon.) label in the first condition branch and type "Log" in the text box and press the Enter key to have the editor fill in the rest of the action. Workflow Conditions
    2. Click the this message link inside the Log to History List action and type "This items color choice was red" in the text-box field. Workflow Conditions
    3. Repeat the previous steps to add a Log to History List action inside the other two condition branches with messages reflecting "Blue" and "Green". The final condition branches should look like the following image: Workflow Conditions
  3. Click the Publish link in the Workflow tab toolbar to update the SharePoint site with the current changes.
  4. 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 of Item One.
    3. Click the Workflow Demo-WF link under the Start a New Workflow heading.
    4. Click the Start button to start the workflow.
    5. Click the Completed link in the Workflow Demo-WF column for Item One.
    6. Verify the Workflow History has an entry with a message appropriate for the items Colors field. Workflow Conditions
Next