Now that you've gotten your feet wet with a simple Workflow Conductor use case based on the Request Approval widget, let's make things more interesting by adding conditional branching, sequential approval, and SharePoint field updates. I'll also throw in some workflow start options. And because I know we all have those senior moments, I'll show you some ways to make it easier to remember what your workflow does by customizing widget names. So fire up your free 30-day trial version of Workflow Conductor and get your receipts ready – it's expense report approval time!
THE SCENARIO
Your company submits expense reports using an InfoPath form. Expense reports less than or equal to $1,000 can be approved by the employee's manager, but expenses over $1,000 must also be approved by a VP. Expense reports are currently e-mailed for approval, but you want a way to enforce the approval process for larger expenses and employees want more feedback on where the expense report is in the approval process.
BUILDING THE WORKFLOW
Step One – Set Up SharePoint
- Create a Forms Library called Expense Reports, with an InfoPath expense report form published to it. I used the sample InfoPath Expense Report form, with some minor modifications, described next.
- Add fields to your InfoPath form for the employee, manager, and VP account names. Publish these fields, and the expense report Total field, to your Expense Reports library. (For some tips on making these fields lookups to the SharePoint User Information List, see my companion post: Using SharePoint Data in InfoPath Forms: How Does It Work?)
- Add a new Choice field in the Expense Reports library called Approval Status, with five choices: Waiting for Manager Approval, Waiting for VP Approval, Approved, Rejected by Manager, and Rejected by VP.
- Save a completed expense report form to the Expense Reports library.
Step Two – Launch Conductor Studio
Launch Conductor Studio from your Expense Reports library by clicking Settings > Create or Edit Workflows.
Step Three – Building the Workflow
This workflow will use the Request Approval, Conditional Branch, Update Item, and End Workflow widgets. After configuring each widget, make sure to click the Apply button at the bottom of the Widget Properties tab to save its settings.
1. Request Approval
All expense reports have to be approved by a manager first, no matter how much they are, so let's start by dragging a Request Approval widget to the Studio diagram. As I mentioned in my previous use case for Document Approval with Multiple Approvers, the Request Approval widget is highly customizable. You can read about each property in detail in the Workflow Conductor Online Application Notes. For the purposes of this scenario, we're interested in the following properties:
- The Approvers property is a lookup to the "Manager" field in the Expense Reports library, which gets populated by the InfoPath form. You can't throw a widget in Conductor without hitting a lookup, so make sure to read more about them in my previous post: Workflow Conductor Lookups, References, and Variables.
- The Allow Request Change property is set to Yes. If you've ever had an expense report rejected for something trivial, you know how frustrating it can be to have to start the whole process all over again. Allow Request Change lets the approver assign a new task for someone else to complete first, such as having the employee add that missing name to a meal expense. When that task is completed, the approver is notified and can pick up where he left off.
- Some basic information about the expense report is provided in the Task Name and Task Description properties. Since we want the approving manager to have at least a basic idea of what he's in for, several lookups to actual expense report data have been included in these properties. (See what I mean about lookups? They're everywhere!)
2. Conditional Branch
Since no business process ever runs in a straight line, Workflow Conductor includes the Conditional Branch widget. To make the workflow check if an expense report needs additional approval, drag a Conditional Branch widget inside the Approved branch of the Request Approval widget. To set the dollar amount condition required by our scenario, click the next to the Condition property to display the Condition Builder, and configure it as shown here. With this condition, anything over $1,000 will follow the True branch, and anything $1,000 or less will follow the False branch.
3. Request Approval (Take 2)
Yes, I know we already have a Request Approval widget, but that was for manager approval. To get VP approval, the expense report needs to go to someone else. In Workflow Conductor, you can have as many versions of a widget in a workflow as you want, so go ahead and drop a new Request Approval widget inside the True branch of the Conditional Branch widget (remember, True matches anything more than $1,000). Configure it the same way as the original widget, but this time use a lookup to the "VP" field in the Approvers property.
Tip: You can also just copy and paste the original Request Approval widget. Conductor will copy the widget properties too, so this will save you some configuration time. Right-click the widget and choose Copy, then right-click inside the Conditional Branch widget's True branch and choose Paste. All the properties of the Request Approval widget are copied, including any widgets inside it, so be sure to delete the extra Conditional Branch widget by right-clicking on it and choosing Delete.
4. Update Item
Remember how employees wanted to see the status of the expense report? In my previous use case, I used the Set Approval Status widget to update an "Approval Status" column. Set Approval Status is great if the status you need to provide is in the pre-defined list included with the widget, but we have some custom statuses in today's example. We like to give you options, so Conductor has two other widgets that perform a similar function: Update Item and Set Field Value. Either will work here, but I'm going to use Update Item because it's a little faster to configure if the field you want to update already has possible values in a Choice field. I'm going to sprinkle it all over my workflow to give employees the updates they crave:
5. Name That Widget
Are you starting to get a little cross-eyed with all these widgets-within-widgets and Update Items everywhere? Me too. Let's take a moment to make our workflow more readable by renaming widgets, starting with all the Update Items. Click on each one and change the Display Name property to something a little more descriptive, like the actual status name. (Don't forget to click Apply!) You'll see that the widget names now reflect whatever you typed. Do the same with the Request Approval widgets and the Conditional Branch widget, and suddenly your workflow makes a lot more sense:
6. End Workflow
Now that you can easily follow along in the workflow diagram, you might be wondering what happens if an expense report gets rejected somewhere. If it gets rejected early by the manager, the workflow simply updates the status and ends, since the workflow would follow the Rejected path of the first Request Approval widget and there are no widgets after it. No problem, since this is what we want. However, if an expense report is over $1,000 and gets rejected by a VP, the workflow as we currently have it configured would update the "Approval Status" column to Approved when it exits the Request Approval and Conditional Branch widgets. You can see what I mean in the previous screenshot.
To keep this from happening, drag an End Workflow widget to the Rejected branch of the second Request Approval widget. Now the workflow ends where we want it to in case of a VP rejection:
That's it for building and configuring the workflow. Let's deploy it and see what happens when it runs.
Step Four – Deploy the Workflow
Go to Publish > Deploy in the Conductor Studio menu, give your workflow a name and an optional description, and click Save. Your workflow gets deployed and is now available in your Expense Reports library. Just for reference, here's what our completed workflow looks like:
RUNNING THE WORKFLOW
You can always start a workflow manually by choosing the Workflows option in an item's drop-down menu, and you'll probably do this when testing workflows. If you want to make it simple on your employees, you could also kick the workflow off automatically whenever a new expense report is created:
- In the Expense Reports library, go to Settings > Form Library Settings.
- In the Permissions and Management section, click the Workflow settings link.
- In the Change Workflow Settings page, click the name of the workflow you deployed.
- In the Change a Workflow page, check the box in the Start Options section to Start this workflow when a new item is created, and click OK.
However you choose to start it, here's what will happen when the workflow runs:
1. The workflow starts by setting the "Approval Status" column to Waiting for Manager Approval.
2. An approval task is created for the manager the employee chose in the InfoPath form, and the manager receives a task notification e-mail with a link to the InfoPath expense report form and a link to complete the task.
3. The manager has the option to Approve or Reject the task, or can create a new task for someone else using the Request Change button. Check out the Workflow Conductor Online Application Notes for more details about Request Change.
If the manager rejects the expenses, the "Approval Status" is updated to Rejected by Manager, the employee is notified, and the workflow ends.
4. If the expense report is over $1,000 and the manager approved the expense report, the "Approval Status" is updated to Waiting for VP Approval and the VP the employee entered in the InfoPath form is assigned an approval task.
5. The VP has the same options the manager had to Approve, Reject, or Request Change. If the VP approves the expenses, the "Approval Status" is updated to Approved, the workflow ends, and the employee is notified.
If the VP rejects the expense report, the "Approval Status" is updated to Rejected by VP, the workflow ends, and the employee is notified.
IN SUMMARY
We covered a lot of new ground in this use case, so let's review:
- No matter how complicated the workflow is, it's simple to create with the Workflow Conductor drag-and-drop user interface. No coding required! You can even "comment" the workflow by customizing widget names.
- The Conditional Branch widget adds intelligence to your workflow and lets it do different things depending on SharePoint item properties.
- Supercharge your InfoPath form libraries by integrating them with Workflow Conductor workflows.
- Copy & paste widgets, including their properties, to save time!
- Need to update a SharePoint field? Try Update Item, Set Approval Status, or Set Field Value – whichever best fits your needs.
- Workflow Conductor integrates with native SharePoint workflow functionality to allow you to change workflow start options.
Have a suggestion or tip for improving this workflow? Post your comments below or in the Workflow Conductor forum. Stay tuned for more sample workflows and tips for using Workflow Conductor to its fullest potential.