Tuesday, July 24, 2012

SharePoint Designer 2013 Workflows: Part 1 – Stage…a new step in revitalized SharePoint era


One of the cool new feature of SP 2013 workflows is ‘Stage’.

Stage is similar to step in SP 2010. It groups conditions and actions.

Conditions and actions are executed in order.

Step in SP 2010 also groups conditions and actions. It too executes conditions and actions in order. Then what is the difference between both.

Here is the interesting factor. The difference is new ‘Transition to Stage’ feature.
At the end of execution of condition and actions in a stage there is this block. In transition to stage section we can add condition and ‘Go-to’ action. Yes you are reading it right. Now we have ‘Go-to’ action. Many of us wanted this action while writing workflows with complex business rules. SharePoint Designer 2013 makes it very easy with ‘Go-to’ action.
This action gets visible in actions’ list when focus is in transition to stage section.
This action allows us to execute/navigate to particular stage or at the end of workflow.
Remember, transition section should not be empty.
Let’s take one real example here.
We have very common scenario:
Send email to user after every 10 days after item creation if status is ‘In Progress’.

Solution is very simple using SharePoint Designer 2013.

For this example I have created simple custom list with additional choice column named ‘Status’. It contains two choices In Progress and Complete.
1.      Create workflow for your list. Select platform type ‘SharePoint 2013 workflow’.
2.      Enable workflow to start when item is created.
3.      You will get ‘Text based designer view’ as follows.
4.      Rename stage appropriately. I renamed it to ‘First Stage’.
5.      Add log action to add some meaningful log.
6.      Add condition to check if status is ‘In Progress’.
7.      Add ‘Pause for Duration’ action and set duration as 10 days.
8.      In else condition add log with proper message.
9.      In transition to stage section again add condition to check status.
10.  In this condition add ‘Go-to’ action.
11.  You will get stages in workflow and additional ‘End of Workflow’ option in dropdown for go-to options.
12.  Select ‘First Stage’.
13.  In else condition add ‘Go-to’ action with selection as ‘End of Workflow’.
14.  Check for errors, save and publish workflow.

 Now your workflow is ready to test. Test workflow by adding item to your list and see the magic.

This ‘Stage’ feature with ‘Go-to’ action saved lot of complex logic in workflow and additional columns/lists to get similar functionality.

Liked this feature?

6 comments:

  1. I've created SharePoint List with Column Name - Order Status (ORDERED or NOT ORDERED). I need to send weekly alert mail for items which have "NOT ORDERED". I don't have access for VS or TimerJob. I've only access for SharePoint Designer. Please provide steps or link to archive this.

    ReplyDelete
    Replies
    1. Sharepoint 2013 has a loop until condition, also known as a 'while loop'.

      Loop while not equal
      send email
      Pause for xx days
      end loop.

      Delete
  2. Really Great Thanks. Loop condition does it in more efficient way

    ReplyDelete
  3. Hi I have workflow 2013 with App step , but it fails when I do Stage transition. I have done correct App setup.

    ReplyDelete
  4. thank you for your interesting infomation. https://view.ly/v/XcqhuxSPDA0R

    ReplyDelete