Then, this happened.
Along with iOS 12, there shipped something called Siri Shortcuts.
Siri Shortcuts let you quickly do everyday tasks, and with the apps you use the most — all with just a tap or by asking Siri.
If you are familiar with MS flow, it is kind of same for native phone apps, typically. For eg., you could press a button and make a series of predefined things happen. You can say “Drive Home” and the Siri automatically plays your favourite playlist, shows the driving direction and sends an ETA to your spouse or you can point at a star and ask which star you are pointing at and so on.
A lot of native iOS apps already support Siri Shortcuts and we can also build custom shortcuts for the apps that supports Siri Shortcuts.
So, I wondered what if I summon Her Majesty Siri herself to do this for me!
But Dynamics 365 is not a native app nor it supports Siri Shortcuts, so how are we going to perform an action in D365 from Siri?
Fortunately, there is a way if D365 has an open api, and it turns out it does.
I know what you are thinking! How in the world am I going to trust Siri with this task, given her notoriety. To be honest and fair, we are in the world of baby bots, no one has general purpose virtual assistant that is perfect, yet.
Let’s give her a fair chance and see what she can do for us.
Let’s say there are a few cases scheduled for the field agents and the day in a life of a field agent would be to check the D365 (preferably on mobile) for their upcoming schedule and visit the location, fix the issue and subsequently close the case and move on to the next.
When you run the above sentence in a slow motion, there are so many detailed steps involved which could add friction to the process. But, how does the above process look when we completely remove the friction involved? – It is as simple to call Siri “Hey Siri, give me the location I am scheduled next” and the Siri would do the heavy lifting of retrieving the service request assigned to him/her, puts the status to “In Progress”, parses the location and sends it to the user, which the native map app automatically opens to show it.
And when the field agent resolves the request, he/she would call Siri, “Hey Siri, close the service request”, which will update the same service request retrieved earlier to “Resolved”.
We have dramatically simplified the entire human workflow by summoning the bot.
Traditionally, these processes have been handled by paper trails, which we all laughed at and called it “manual” process. In my humble opinion, the process of asking the user to login to the website, navigate the desired page/record to fill in the details is no different to the paper process that dominated the mankind 20 years ago.
Okay. How does our design look:
It is quite simple. We setup a Siri shortcut, which will call the MS Flow, which in-turn executes the desired actions in D365 and eventually the MS flow will send the desired results back to the Siri Shortcut.
Ask for the service request location
Create a new MS Flow and add a Request action to receive the request object from Siri Shortcut. This request action will generate an URL that will be used by the Siri Shortcut to trigger the flow.
The request that we obtained from Siri Shortcut will have the userId data. In the next Flow action, we retrieve the service request for this userId and update the record’s status to “In Progress”.
We also extract the location (address) of the service request and send it to the Siri Shortcut using the “Response” action.
Create a Siri Shortcut which will send a POST request to an URL (MS Flow) with the userId. When the Siri Shortcut gets the result back, it passes the result to the Map app which will plot the location on the map.
There are 3 actions used:
- URL Action – Add the URL generated by the Flow. Siri Shortcut will need this URL to trigger the Flow.
- Get Contents of URL – This action will invoke the URL with the POST method by passing the JSON body which contains the userId. This user id will be used to filter the service request in D365. The result of this action will be the location of the service request.
- Show in Maps – This action will take the result of the previous Get Contents of URL action, which is nothing but the location and show it in the map.
The above steps enable you to run this shortcut from the Shortcut app, but even better, you can summon Siri to run this shortcut without even opening the app.
I have setup a “Siri Phrase” “Show my next service request location”. This enables the field agent to just talk to Siri in order to show the location on the map.
Ask to close the service request
This is very similar to the above implementation.
Create a flow which will take the Request object (that has userId), and retrieve the service request for the userId that is In Progressand set it to Resolved.
Create a Siri Shortcut which will trigger the Flow with POST method.
Set a Siri Phrase “Close the service request”, so the shortcut can be run without opening the Shortcut app.
This is dramatically simple enough. But you may ask what if the agent wants to update more details on the service request closure such as Resolution Details, additional comments etc., The examples I have shown here is just a start. I am confident that we can accomodate those scenarios as well in Siri Shortcuts, which i’ll plan to cover in some of the future posts.
Obviously, this is a proof of concept and hence it is superficial. For the production grade application, we would abstract a few components and make it much more seamless and reusable.
The evolution of bots opens up a lot of possibilities, which could positively impact the daily life of the people around us. Imagine your city publishes a bunch of Siri Shortcuts for their citizens to download and use it to report service requests/incidents. Imagine a business publishes shortcuts to order products lighting fast. Imagine health providers publishes shortcuts to schedule appointments. The scenarios are just endless as we need to convert whatever we converted from paper processes to website applications to bots.
This is interesting because now you have access to rapidly growing native iOS apps’ connectors on top of rich connectors that flow offers.
Citizens do not have to download third party app to perform these voice commands or ride through a learning curve. If they know how to use Siri, they are well qualified to use this.
As Siri and Siri Shortcuts are native to iOS, Apple has integrated this tightly into their platform and makes it really user friendly and easy adoptability.
This is just a beginning. Can’t wait to discover all the creative ways that this approach allows us to interact with the business and consumer focused applications.
Check out Dhina's blog here.