Automate Business Actions with Microsoft Flow, PowerApps and Kaizala

In this article, I will show you how to use Microsoft Flow, PowerApps and Kaizala to automate end-to-end business processes for daily operations. We will look at a logistics management use case wherein we will see how to automate an item pickup and delivery management process.

The scenario is of a logistics company that provides door to door delivery of items. These items are collected/ dropped off at one common warehouse of a region. The details of the item (item ID, destination address, email address of the receiver etc.) are populated to a SharePoint List through a canvas app. Region wise groups are created on Kaizala and the delivery executives are added as members to this group. A custom survey action has been designed to track the delivery item from pickup to delivery. A flow is triggered when a new item is registered on the SharePoint list and a custom action with the item ID is sent to the Kaizala group. Another flow is triggered based on the response received on this custom action. A flow is scheduled to run everyday and get a list of items that were not delivered the previous day and the action is sent to the group for each of these items too. The SharePoint list and the customer are updated with the details received from the delivery executive through the custom action. Once delivered, the customer and the region manager are notified via an email that the item was delivered along with a picture proof. Upon a failed delivery attempt, the delivery executive returns the package to the warehouse and another delivery attempt is made on the next day.

Let's explore the component wise structure of this solution. I have created a SharePoint List named "Item Details" with all the required columns to store the information from the delivery executive and the entries made at the warehouse.

Canvas App

The canvas app is of a mobile phone layout and is created directly from the SharePoint List (Item Details). It will be used by one of the warehouse managers to track the items in that particular region. The warehouse manager is responsible for creating the new entries for each item that is dropped at the warehouse. Once the item details are filled in and saved on the SharePoint List, a Flow is triggered to post this in the Kaizala group. The available delivery executive checks the details of the item to e delivered and marks that they have received the item on the Kaizala app. This response is saved on SharePoint and the details are updated on the canvas app. This way, the warehouse manager keeps a track of all the items and can search for any particular item at any time and get the latest update on that item.

The first screen of the app displays all the Items to the warehouse manager based on the data available on the SharePoint List. The warehouse manager can get more details on a particular item by going to the details screen (2) and get the latest updates/ details on that item. The warehouse manager can create new entries by clicking the '+' icon on the home screen (1) and is navigated to the screen (3) where they can enter the item details. The warehouse manager can only create or update the columns shown on screen 3. The rest of the columns are filled by Flow based on the responses on the custom action.

P.S. the data shown in the app images is sample data.

Kaizala

Download the Kaizala app and sign up from your mobile phone. You can manage the groups, settings for these groups, custom actions, connectors etc on the Kaizala management portal that can be accessed here.

The Kaizala action that I have created is a simple customised survey action with 5 questions and enabled the request location option to get the real-time location of the delivery executive when they respond to the action.

Item Received: Type: Options- Yes/No.

Current Status: Type: Options- On the way, Delivered, Delivery failed.

Comments: Type: Text.

Delivery Proof: Type: Image.

Order ID: Type: Text.

A new custom action can be created from the Kaizala management portal -> Extensions -> Actions -> Create a new action. There are ready made templates for Forms, Announcements, Surveys, Attendance etc.

Once the custom action is ready, we need to make some small tweaks in the package file and the response summary to make the action editable once a user has responded. For this, download the zip file of the custom action and make the response edit flag to true from the package.json file. A detailed explanation of each of the modules on creating custom actions in Kaizala have been explainedhere.

Once the action is ready, ensure to upgrade the version number of the package and zip the contents of the previously extracted folder. Now, on the Kaizala Management portal -> Extensions -> Actions -> Create a new action, select import and upload this zip file. You will see that the action file will be uploaded with the version number that you have provided and now you can activate the action and add it to the groups on Kaizala.

On the Kaizala Management portal -> Groups -> Create Group and create a new group. Add members to the newly created group and assign the relevant roles. Now, you can add the custom action to the group and select how users can interact with this action.

Above, are the screenshots of the custom survey action from the Kaizala Mobile App. The first screen shows the action canvas in the chat window. The second screen is the responses from the user and the third screen again displays the updated action canvas in the chat window.

Flow

Now let’s look at the Flow part of the solution. We will be using three flows for automating the complete process.

Flow 1:To send an action on the Kaizala group based on the SharePoint item created from the canvas app.

In this flow, I have used the trigger: "When an item is created in SharePoint" and then used the action "Send action on a group in Kaizala". In the body part of the action, add the following:

{
"actionBody": {}
}

Within the "actionBody", copy the entire appmodel.json contents and save the action. Add a description field and select the "Title" option of the newly created item to append along with the description for the custom action. (this will give the user the item ID).

Flow 2:To keep updating the SharePoint list and the customer with the package status when the delivery executive responds/ updates on the Kaizala action.

Trigger: "When someone respond to a custom action in Kaizala"- Select the group, the newly created action package and set the action to 'All' (Note: Every time a new version of the action is published in Kaizala, the action should be reselected here to point to the updated version as the current flow might point to the previous version)

Action: "Initialize a Variable": This is a string variable to store the image content received as a response from the user for the delivery proof.

Action: "Get Items from SharePoint": This is to get the item from the "Items List" SharePoint List and the particular item is identified by the ID that is input by the user in the custom action. I am using the ODATA Filter query to get the item that only matches with this answer. The outcome of this action is of a "List" type but in this case, the list will have only one element.

Control: "Switch": Here I am using a switch control over the delivery status input received from the delivery executive. Based on this, if the item is delivered, the SharePoint list is updated, the delivery proof is attached to the item and an email with these details is sent to the customer and the warehouse manager. Similarly, if the item is undelivered or on the way to be delivered, the SharePoint List is updated and an email is sent to the customer and the warehouse manager.

For the case as Delivered:

Action: "Parse JSON": This is to parse the action answers for the image question on the custom action. The image content URL is extracted from this action.

Action: "Send and HTTP Request": A GET request is sent to the URL retrieved from the Parse JSON action to get the image content.

Action: "Set Variable": the content extracted from the above action is now stored into the variable.

Action: "Update Item in SharePoint": Here, I am updating all the columns of the item on SharePoint with the relevant responses from the custom action.

Action: "Add an Attachment to a SharePoint list item": Here, I am adding the image (applying a base64 to binary conversion on the content retrieved) as an attachment to the SharePoint item for the proof of delivery.

Action: "Send an Email": Through this action, an email is sent to the customer and the warehouse manager that the item is delivered and the delivery proof is added as an attachment.

Flow 3:To get the items for which the delivery attempt was failed and send that as new action on the next day to the delivery executives’ group.

This Flow runs on a schedule (every morning at 8:45) and gets the items from the SharePoint list. A condition control is set to check the Delivery Status of the item and if it is Delivery Failed, the custom action is sent to the Delivery Executives' group (similar to Flow 1).

In this article I have shown you how to automate a product delivery management process using PowerApps, Flow and Kaizala. We can use the already available actions in Kaizala for daily processes such as announcements, polls, surveys, job assignments, employee attendance etc. To maximise the efficiency using the OOB available actions in Kaizala, upvote the ideahereto include the triggers for these already available actions in the Kaizala - Flow Connector.

I hope you found this interesting and it helped you. Thank you for reading!

Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online).
Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!

Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.