Sivarajan's Blog

SharePoint | Office 365 | Azure | JavaScript

SharePoint 2013 Designer Workflow – Creating a Custom Task Outcome – Part 3

Overview

In this post, we will see that how to create the custom task outcome. First we will see what that is and why the task outcome is so important.

Default Task Outcome

By default, if you assign a task to someone in SharePoint 2013 workflow, the task output will look likes below.

2014-01-29_01

But as per our helpdesk workflow requirement, while employee raise a ticket, the new task will be created and assigned to IT Admin user group. In this stage (Waiting for IT Admin Approval stage), he can either assign to Support Team for implement or assign back to Employee if there is any clarification and he is not going to approve or reject functionality. So our new task form output will be look like that,

2014-01-29_05

We need to follow the below steps for implementing the new requirement.

  1. Create a new Task Outcome Column
  2. Create a new Content Type
  3. Changes in Helpdesk Workflow
  4. Use the Task Outcome

Step 1: Create a new Task Outcome Column

We will create a new site column RequestClarificationOrAssign with the following values

2014-01-29_02

Step 2: Create a new Content Type

We will create a new site content type Request Clarification Or Assign - IT Admin View based on Workflow Task (SharePoint 2013) Content Type. And then add a site column RequestClarificaitonOrAssign with newly created content type.

2014-01-29_03

Now add this content type with Helpdesk Task list and the task list content type will look like,

2014-01-29_04

Step 3: Changes in Helpdesk Workflow

  1. Edit the Helpdesk WF workflow using SharePoint Designer 2013
  2. Inside the Waiting for Approval Stage, select the Assign a Task to IT Admin action
  3. Select the Task Properties
  4. Expand the Outcome Options
  5. Select the Task content type as Request Clarification Or Assign – IT Admin View
  6. So the output will look like below
  7. 2014-01-29_06

Save and republish the workflow. When we create the new task, the task output screen will look like below

2014-01-29_08

Step 3: Use the Task Outcome

IT Admin will click either the Request Clarification or Assign button. So we should capture the action using local variables and will use in If condition action

  1. Again select the Assign a Task to IT Admin action
  2. Select the Task Outcome
  3. Create the local variable ReqClarificationOrAssignOutcome

2014-01-29_07

4. Now edit the If condition next to Waiting for Approval stage

5. Set the local variable ReqClarificationOrAssignOutcome like below

2014-01-29_09

6. Based on the IT Admin action, the next stage will be either Request Clarification or Assign for Implementation

Summary

I hope that now we know how to create and use custom task outputcome.

Comments (10) -

  • Joe

    5/15/2014 8:38:45 AM | Reply

    Great example. I've implemented this but what if I want to make a field required based on one of the outcome choices? Is there a way to add some JavaScript to the form to achieve this?

    Thanks

    Joe M

    • Sivarajan Raju

      5/18/2014 6:21:34 PM | Reply

      We can achieve this using custom task form.

  • Rama

    7/10/2014 11:43:30 AM | Reply

    HI,
    Thanks for the example.
    My scenario is I don't want to show  %completed and taskstatus columns on forms.
    Did you ever try to hide those columns from your content type , it will not show approve reject buttons.
    Do you have any work around for this.

    Regards
    Rama

  • Jaganathan

    7/14/2014 6:25:07 AM | Reply

    Many Thanks..
    for me its working

  • Jaganathan

    7/15/2014 6:01:44 AM | Reply

    Hi,

    I followed this article and created a task outcome and works fine. Many Thanks.
    Is it possible to remove some field from task list?
    for example i want to remove "%Complete" or "Task status"
    i tried to remove them in such cases the task outcome is not visible as buttons, rather it is shows as choice field.
    Please let me know how i can achieve this?

  • Sagar

    8/11/2014 12:22:02 PM | Reply

    Hi
    THanks for the great post.
    However I'm not getting the Request Clarification & Assign as a buttons. Instead I'm getting Request Clarification and Assign options in the drop down list on the form.
    Could you please let me know why this is so.

    Regards,
    Sagar

  • Nitin

    12/4/2014 11:56:28 AM | Reply

    Great Article! How can I remove % completed and other irrelevant fields from the new form.

  • Rama

    1/6/2015 6:44:43 PM | Reply

    My scenario is I have dynamic approvers which are being set from 2 columns in the list. I am using assign task process to create task. Business case is user can approve/reject/SendBack. Functionality of sendback is to request for more information. If any user clicks on sendback it will trigger mail to admin requesting more info when user is satisfied user will click on approve or reject. If any user clicks on reject workflow will be rejected completely.

    Any help is appreciated. Thanks in advance

  • JD

    6/28/2015 5:15:15 PM | Reply

    Is it possible to send the task outcomes to a custom task list instead of the general task list on the site.  I am looking at solution with no coding, will appreciate your help.

  • Raj

    10/16/2015 12:16:12 AM | Reply

    Hi, thanks for sharing this,

    could you help me, is there a way to get description text of a task form that will be entered by approver when he gets a Task from Task Process action.

    As, Task process is having only one outcome variable, i am not able to get approver's comments which he enters in description field.

Add comment

Loading