As the fastest growing business app in the history of our company, Microsoft Teams is gaining a strong foothold with our Office 365 enterprise users. Millions of enterprise employees are now starting their day in Teams, living their day in Teams and wrapping up their day in Teams. One of the core value drivers within this productivity workspace is its extensible and customizable platform – essentially bringing modern SaaS app experiences within the scaffolding of the product itself. Thanks to 250+ apps on the public app store and countless more on private, organization-specific app catalogs inside Teams, it’s natural for a typical user to expect her organizational tools and most importantly, common workflows to be accessible inside Microsoft Teams.
Broadly speaking, there are 2 methods of surfacing your organizational workflows inside Microsoft Teams:
LCNC democratizes creating and surfacing workflows as “apps” inside Teams – enabling (a) a modern end-user experience in addition to (b) low cost and time of workflow development. During our evangelism and consultative work with some of the top enterprise customers using Microsoft Teams today, approvals is one such kind of workflow that seems to exist universally.
Let’s see how you can build a simple approval workflow the LCNC way using just SharePoint Online + Microsoft Flow + Microsoft Teams, and nothing else - no web browser, no email, no Microsoft Flow mobile application etc. participating in the mix. The entire workflow will begin and end for all participants within Microsoft Teams itself – resulting in minimum context switching and maximum productivity.
Let’s imagine that you manage the Travel Desk for your company. Your team arranges home drops via a company-owned shuttle service to employees staying late in the evening beyond regular transport hours. You want to surface a shuttle request workflow within Microsoft Teams whenever a new drop request is made by an employee. One of your Travel Desk team staff needs to look into the request, validate against policy and then approve it. The requester employee must get notified with the status of their request in Teams.
Employee team in Microsoft Teams: A team titled Vishrut’s Workgroup has been created by teamify-ing the SharePoint site created above. This will make it easier to pin the list as a tab since the list is part of the team’s corresponding SharePoint in backend.
Employees staying late in Vishrut’s Workgroup now can use the SharePoint tab in the Staying Late channel to request for shuttle drop using the ‘New’ action.
This is how you – as the manager of the Travel Desk – design a simple approval flow for approvers on your team:
Here’s how you set it up using connectors in Microsoft Teams and trigger/action in Microsoft Flow:
Once the Incoming Webhook connector is successfully setup, you’ll see the following notification in the channel.
Test out the Flow you just created by adding a new item in the SharePoint list from the channel tab in Staying Late channel as follows:
You should see a rich Connector card appear in the Cab Requests channel as follows:
This is powerful since your Travel Desk team now has the request – from an external system - appearing directly within Microsoft Teams where they can collaborate around it. For example: you can @mention a specific team member of yours to check whether the requesting employee’s can avail the shuttle drop facility by company policy or not.
Notice the Approve and Reject action buttons on the connector card posted into the channel. Your approver can decide to action on the request and even add their comments. The JSON payload for the card you specified in the Body field of the HTTP action contains the actions. Here’s the snippet that defines what should happen when the user chooses the action Approve.
The most important piece in the JSON code above is the “target” value specified which defines the URL endpoint of the service that receives and then acts on the action made by the user (your approver in this case). At a high level. this is what happens when the approver hits Submit on the card:
This means the target URL is basically an Internet-reachable endpoint which can receive action data. So how do you obtain the target URL for your approval flow?
This is the essence of our low code / no code solution. Usually, target URLs need a web service to be run and exposed on the Internet. However, Microsoft Flow’s trigger “Request — When a HTTP request is received” does exactly this. The trigger generates a HTTP POST URL, which can trigger a Flow whenever an incoming API call hits this target. Therefore, we setup another Flow with this trigger.
We will also need a JSON schema defining the format of the request that will hit this HTTP target endpoint. To simplify schema creation, you can use one of many schema generators available on the web for eg: jsonschema.net. A reference schema for the connector card is available on GitHub to get you started.
The HTTP POST URL will get generated once you Save the Flow.
This URL needs to be picked up and inserted as the target URL in the Connector card’s JSON Body field defined in the first Flow you’ve setup. Note that the same target URL is specified in case of both actions – Approve and Reject.
Only the Boolean values contained in the ‘approved’ key as part of the HttpPOST body section differentiates between either decision. In the section titled “Updating the SharePoint list item” below, we use the Boolean to populate Request Status Value field in the SharePoint list item.
The subsequent actions for this Flow look like the following:
Basically, the remaining steps of the Flow deal with receiving the HTTP payload coming to the target URL, parsing the same, extracting required information such as the action taken, comments and the identify of the person who’s taken the action in order to store it in the same SharePoint list. This is how it is achieved:
It is imperative to give both the reviewer and the requesting employee feedback once the approval is executed.
We hope this hands-on blog post has enabled you to set up your first LCNC approval workflow in Microsoft Teams using just SharePoint Online + Microsoft Flow, Connectors in channels and nothing else - no web browser, no email, no Microsoft Flow mobile application etc. Happy approving!
Special thanks to Wajeed Hanif Shaik - our Microsoft Teams platform developer support engineer who was able to get this LCNC approval workflow up and running in a matter of a few hours!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.