Develop a custom OR approval workflow in SharePoint Designer

Introduction

Developing approval workflows in SharePoint Designer is not always the easiest or most intuitive process.  This example shows how to create a simple OR approval workflow in SPD.

Scenario

A document is submitted to a SharePoint Document Library (or item list) for approval.  The workflow for the approval is outside of the capabilities of the out of the box approval workflow provided with SharePoint.

The approval needs to be done by one of two (or more) people.  The workflow stops when one of them approves or rejects the request.

SharePoint

1. On your SharePoint list/library, create a new column to store the approval text

clip_image002

 

SharePoint Designer

2. Create two new variables

clip_image004

3. Create a new action

a. Add a “Collect Data from User” actions.

image

- When creating the “Collect Data from User” actions, create them to capture the data as a choice. Assign values to the choice as “Approved” and “Denied”

clip_image008 clip_image010

HEY! When creating a workflow in SharePoint Designer, the workflow will attach itself to the first task list in the “Lists” gallery. To ensure that the workflow was attached to the correct task list, I named it with “AAA” at the beginning of the name. (This can be changed later with no impact to the workflow.)

For more information on this - CLICK: Change Task List Associated with a Custom Workflow

4. Create a second Workflow Step

5. In the first condition, read the value of the workflow variable assigned to collect the data from the first “Collect Data from User” action and validate that the value returned is “Approved”.

6. Add a second condition to that condition block with the OR operator. Set this condition to read the value of the workflow variable assigned to collect the data from the second “Collect Data from User” action and validate that the value returned is “Approved”.

7. In the action step, set the value of the column you created in the SharePoint List/Library to a value representing an approval response.

8. Add a second action to stop the work flow

9. Add a second condition block.

10. In the first condition, read the value of the workflow variable assigned to collect the data from the first “Collect Data from User” action and validate that the value returned is “Denied”.

11. Add a second condition to that condition block with the OR operator. Set this condition to read the value of the workflow variable assigned to collect the data from the second “Collect Data from User” action and validate that the value returned is “Denied”.

12. In the action step, set the value of the column you created in the SharePoint List/Library to a value representing a denied response.

13. Add a second action to stop the workflow.

image

Gotchas 

There is a limitation to this process: When attempting to view tasks assigned to individuals in the group, the SharePoint list does not automatically associate the logged in user to the group assigned to the task.  To address this, you will need to some XML.  Follow this link to get the details!

Assigning SharePoint Tasks to Groups

 

Thanks for listening.