approved1.jpg

SharePoint Workflow Approval by Only One Member of a Group

I recently had a need to create an approval workflow that would assign an approval task to a group of people but would only need one person to actually approve or reject the request. I’ve worked on several fairly complex approval workflows but have never had to allow for this. So I searched around for a bit (how did us developers ever manage pre-internet?!) and I found this Stack Exchange question that gave me the clues I needed to get the job done.

It turned out to be a fairly simple process with only a few places that needed changes, via SharePoint Designer. I know this is only one of many ways I could have accomplished this, so feel free to modify to suit your own requirements.

Note: These steps assume an approval workflow has already been created and is editable.

Set the Task Process to Parallel

The first – and very important – piece is that the task process must be set to Parallel (all at once). The whole idea is that a group of people all have the authority to approve or reject requests but only one is needed to complete it. Thus, whoever can get to the request first will be able to complete the approval, effectively taking it off everyone else’s to do list. If the task process is set to Serial (one at a time), then only the first person in the approver list will be assigned a task initially. The rest of the group will not be assigned a task until each person in front of them completes theirs, which is counter intuitive to the whole idea here.

So here’s how to change this setting. First things first, edit the approval workflow.

Once open, click on the these users link (if you have already set this value, then user names will display here instead).

A dialog will open where you will find a dropdown that allows you to set how the tasks will be created – Parallel (all at once) or Serial (one at a time). After changing, click OK to return to the workflow edit screen.

 

Change the behavior of a single task

The next step is to modify the code in the When a Task Completes section.

You get here from the workflow edit screen by clicking on the name of your process in this case ‘CertificationApproval’. This will open the task process edit screen with various options that allow you to customize your task process.

Once the task edit screen opens, click on the Change the behavior of a single task link found in the Customization area.

Within the When a Task Completes section, add a ‘Set Workflow Variable’ action inside the IF statements for both the Approved and the Rejected checks that sets the IsItemApproved flag appropriately, based on whether Approve or Reject is clicked.

Change the completion conditions for this task process

The final step is to change the workflow completion behavior to be based on this flag.

Navigate back to the task process edit screen and from the same Customization area, click on the Change the completion conditions for this task process link.

When an approval workflow is first created, it generates code that checks task counts to determine if all the tasks have finished and if so, ends the task process. Obviously this will not work when there are multiple approvers (each with their own task) and only one approval or rejection is required.

OOTB Code

By rewriting this block of code to check the isItemApproved flag (now being set when a task completes) instead of task counts, we can control when to end the approval process ourselves, instead of relying on counts.

All that needs to be done here is to replace the OOTB code with checks on the isItemApproved flag. Based on its value, you can perform any number of actions suitable to your own unique requirements. For mine, I only needed to log an appropriate Completion Reason and then call the End Task Process action which triggers the approval workflow to complete.

New Code

Finished!

And that’s all there is to it. Publish the workflow and then start it for an item. Assuming that you’ve assigned a group of people to the approval process you will see multiple tasks created, one for each person.

If you then open one of the tasks and click Approve or Reject, you will see that the outcome for the one clicked will be set accordingly, all the other tasks for this workflow will be set to Canceled and the workflow itself will be marked as complete.

Caroline SosebeeSharePoint Workflow Approval by Only One Member of a Group

29 comments

Join the conversation
  • Tommy Ryan - July 2, 2015 reply

    Thanks Caroline. This is a behavior of a workflow that I think many people would want to have. I appreciate you taking the time to share with the SharePoint Community!

  • Tony Andrews - October 30, 2015 reply

    Hi Caroline, On the New code section, Set Variable:CompletionReason to [%TaskProcess:Process Name%] on [%Ta ….?] Please could you tell me the last option as it is cut off/not showing on the screenshot.

  • Caroline Sosebee - October 30, 2015 reply

    Hi, Tony! Thanks for asking. This step is simply updating the CompletionReason with whatever value make sense for your particular process. In the case above it was set to the following:

    ‘[%TaskProcess:Process Name%] on [%Task Process:Item Title%] has been Approved by at least one person. The workflow will be marked as complete.’.

    The Else IsItemApproved equal to No has a similar message, but it says ‘has been Rejected’ instead of ‘has been Approved’.

    Tony Andrews - November 1, 2015

    Thank you Caroline. Much appreciated will give it go.

  • RG2 - May 6, 2016 reply

    Thanks, this helped me out today.

  • Arthi - July 25, 2016 reply

    Hi..i need to have both serial and parallel approval process in sp designer 2013 workflow.can u help me to achieve the same.

  • Tudor - February 7, 2017 reply

    Hi, great post!
    Do you think it’s even possible to have the approval task assigned to multiple groups and require they all approve it, but inside one group only one member approval is enough?

    Caroline Sosebee - February 7, 2017

    Hi, Tudor! Thanks for commenting. Based on what I know, I don’t believe that would be possible, since a group is expanded into individuals when tasks are assigned and hence lose their group membership associations. I don’t know of a way to retain that info so you can manage an approval at a group level. Of course, someone else might have figured out a way by now, but I have no experience with it. Sorry I couldn’t be of more help!

  • Lyndsey Stephens - February 13, 2017 reply

    What about if there is more than one level of approval? For example:

    Group 1; Group 2 (either can approve)

    Group 3

    Group 4

    Group 5; Group 6 (either can approve)

    Caroline Sosebee - February 26, 2017

    Hi, Lyndsey … Thanks for reading my post! I don’t know of a way to do what you are asking. This is definitely not a scenario I’ve ever run across. Sorry I couldn’t be more help!

    Scott - March 12, 2019

    This is really late…but i just came across this and would like to provide input.

    Since Caroline’s solution when a single person Approve/Rejects is to “End Task Process” then it will only end the workflow if there was only 1 Task created.

    So if you take her same solution, and create multiple stages of approval in your workflow then (assuming your example above) it would work like this

    Stage 1: Assigned to Group 1 & 2. If anyone from either group Approve/Reject, then that STAGE is set to Approve/Reject
    Stage 2: Anyone from Group 3 can Approve/Reject, etc
    Stage 3: Anyone from Group 4 can Approve/Reject, etc
    Stage 4: Anyone from Group 5/6 can Approve/Reject, etc

    Depending on the settings you have on the workflow (e.g. Stop after first reject) then the flow will continue through ALL the stages. SharePoint OOTB workflow will mark this whole thing as Reject if only one stage rejects it.

    Personally, I’m looking for a way to mark a certain participant stage as the “Primary” so that the rest are really just making recommendations and the primary makes the final decision. Still working on that solution. 😉

    But, thanks for the post Caroline!

  • Apoorva Uplaonkar - March 28, 2017 reply

    Hi,
    It is a good post
    But in the task list where approver can see there tasks ,is any aprover from the group approve the task also Modified By is by System account.How do we resolve this problem .
    Thanks in advance

    Caroline Sosebee - June 8, 2017

    Hi, Apoorva .. you might already have this answered by now, but if not here’s a link to more information on this and some possible options for you.
    https://social.technet.microsoft.com/Forums/ie/en-US/3e130006-3fcb-4d39-adad-500fc71ffbde/ootb-approval-workflow-change-the-modified-by-field-to-system-account-when-workflow-is-completed?forum=sharepointadminprevious

    Hope this helps in some way!

  • Megan - June 7, 2017 reply

    This is exactly what I need to build! One question: in the “check completed conditions” screenshot, the last part of the set: Variable:CompletionReason to [%Task Process: Process Name%] on [%Ta…
    is it actually [%Ta… or is there something else there that we can’t see that should be part of the variable?
    TIA for any info.

    Caroline Sosebee - June 8, 2017

    Hi, Megan … glad this can help! And no, there is nothing in particular past that bit of code that would help you. You can set the CompletionReason variable to whatever best fits your specific situation, be it a custom message or some other value you decide. Look at what the OOTB functionality is setting it to and then tweak as you see fit. Hope this helps!

  • Stephanie - August 9, 2017 reply

    This is a great tutorial. Can this be done without designer (out of the box)?

    Stephanie - August 9, 2017

    I have a case where 2 people need to be notified but only one has to approve.

    Caroline Sosebee - September 11, 2017

    Hi, Stephanie! thanks for the comment and sorry for the slow reply. It ended up in spam and I’m just now seeing it. 🙂 I suspect you already have your answer by now, but just in case – yes, with an OOTB workflow you can specify that it run in parallel and then tell it how many approvals are required. In your case, just one. Once one person approves it, all the other outstanding tasks are canceled and the item is marked as approved. I hope this helps!

    PCR - October 3, 2017

    Yes, this can also be achieved while associating the OOTB approval workflow. Add the users in a SP Group. Assign this SP Group as approver Set the tasks to parallel. Uncheck Expand groups. Task emails will be sent to all but only one task assigned to the SP Group will be created. Any member of the group can Approve the task.

  • Faryanni Jasin - October 12, 2017 reply

    hi i tried this and it works perfect, except that coz the task assigned to the rest who did not approve got cancelled automatically after someone approves it, the whole workflow status becomes Rejected. even though one person from the group has approved it.
    it must be due to this (see screenshot)
    https://uploads.disquscdn.com/images/fa62a2a0b6614c267c47b01262c4c07a830dbaf197beef8a24b53da1c1a41eb4.jpg

  • John Colonnello - April 19, 2018 reply

    Great write-up. Question and maybe I missed something, so I did get the part working where only one person has to approve in a group and it is considered approved, but what if you don’t want the whole approval process to be completed because there are a few more stages of approvals that need to occur? Is there a way to move to the next stage/task?

    Caroline Sosebee - April 23, 2018

    Hi, John … my thought is that if you have multiple approval tasks within your workflow, you don’t set this flag until the last approval task step. That way all the other approval tasks flow as normal (if set in parallel) until you get to the last one which would then set the flag triggering the workflow to end. Does this make sense? I have NOT tested this but seems like the logical solution. 🙂

  • Tanmay Gadkari - April 23, 2018 reply

    Hey Caroline,

    This is a great post and it really helped. However, even after replicating the steps exactly as mentioned, I do not get ‘Canceled’ as the Status for the other two approvers ( I set 3 ppl in the list of approvers and approved the item for one). The status continues to be in the ‘Not Started’ state. Is there any suggestion as to what I might be doing wrong?
    I was able to add another condition to the workflow to set the ‘Approval Status’ to ‘Approved’ after one person approves it. Still would be good to know how the status within the task queue can change.
    Thanks for your help!

    Caroline Sosebee - April 23, 2018

    Hi there … are you sure you have the task process set to parallel? If not, this would stop it from setting the other tasks to canceled after the first approval. Otherwise, I’m not sure where the problem might be without seeing the workflow itself. Hope this helps a little!

    Tanmay Gadkari - April 25, 2018

    I was doing it wrong. I had added individual recipients to the workflow instead of assigning it to a group. When I collated the users into a group and emulated the same flow, it seemed to work fine. Thanks for the help once again!

    Caroline Sosebee - April 25, 2018

    Excellent! Glad you got it figured out and glad I could help!

  • Saam Rezaei - May 29, 2018 reply

    Hi Caroline, great post, I am fairly new to sharepoint so I was just wondering, would this script approve/reject changes made to the content in the sharepoint links or something else?
    I need to find a way to approve or deny a request to change the information in a sharepoint.

  • Marut Mahajan - August 12, 2018 reply

    Thank you for the post, its really helpful.
    I am facing an issue while reassigning the task to any other member. After reassigning the task It is setting the Task status completed for all the member to whom previously task was assigned and Workflow status Rejected.
    It would be thankful if you provide any thought on it.

  • Anand - June 10, 2019 reply

    Hi Caroline, thanks for a neat post. Can the approvers be a SP Group or AD group?

Join the conversation

This site uses Akismet to reduce spam. Learn how your comment data is processed.