In this post we will see how we can create/ automate business scenarios with the Microsoft PowerPlatform. (Part 1 of 3)
Business Scenario:
Ctrade Inc. is a small company with 4 employees and they major in cryptocurrency trading. The ideal process they follow is that the employees keep tracking the price data of the cryptocurrencies. They alert the manager through emails/ texts and calls about the prices of individual commodities. Upon getting an approval from the manager they execute the Hold/ Buy/ Sell orders. This executed trade is then populated in an excel file. Now this entire process has multiple manual steps, consumes time and has many open ends. In a highly volatile crypto exchange market, Ctrade Inc. observed that the delay involved in this process causes them a small-scale loss, inefficient transactions, discrepancies in communication with employees etc. and therefore they decide to automate this using the Microsoft PowerPlatform.
Solution:
Here is the high-level architecture of how we are going to address this problem with the Microsoft PowerPlatform. There might be multiple ways to approach this issue, but here is what I personally found was most effective:
- We create a canvas app from PowerApps to save the employee data. (email addresses of all the employees in Ctrade Inc.)
- We create another canvas app to store the trade data obtained from executed trade orders.
- We create a Microsoft flow that is manually-triggered, we provide with our input about the cryptocurrency we wish to get the data on. The flow is capable of extracting data on multiple commodities at the same time. This data is then posted to a Microsoft Teams channel. (all the members of the organisation are already added in the Teams channel) An email with option of Buy/ Sell/ Hold along with the Crypto exchange data is sent to the manager. The manager views that and clicks the option as applicable. This option is returned to the flow. The employees get an email and a message is posted in Microsoft Teams with the decision of the manager.
- Upon executing the trade, the employee makes an entry to the Trade Data Canvas App (Step-2)
- Lastly, we gather all the data from the Trade Data Canvas App and create appropriate charts to view the same.
As an added advantage, the app for adding Employee Data, Trade Data, the Flow app and the PowerBi dashboard can all be viewed across devices (Mobile phones, tablets and computers)
The entire work item is divided into 3 parts:
Part 1: Creating the Employee Data and Trade Data canvas apps from the PowerApps platform:
Step1:
Logon to the PowerApps portal-> Select Data -> Click on Entities -> Click on New Entity. Enter the name of the entity (For the Employees, we enter Employee Data and for Trades we name it as Trade Data) and the properties for the entities respectively.
Step 2:
Click on the newly created entity-> Click on Add Field -> Name the field -> Select Data Type -> Select if it is a required field -> set the other properties and click on Done. Save the entity and click refresh. Now check the entity by clicking on it and see if all the fields have appropriately been created.
The following table shows the fields, properties and datatypes that have been used for the Employee Data and Trade Data respectively.
Step 3:
Click on Apps from the left tab -> Click on create an App -> Select Canvas from the drop down. You will now be redirected to the PowerApps creator studio. On this page, Click on the Common Data Service (CDS) option in the Start With Your Data tab. You will now be asked to connect to a table (an Entity) from the CDS on which you want to base your canvas app. We will select the Trade Data entity for the Trade Data app and the Employee Data entity for the Employee Data App. After making the selection, click on connect and within a few seconds, the Canvas app to input the data to the CDS is ready.
Step 4:
Once the connection is successfully established, you will see the screen as show in the picture below.
Click on the play button and you will have three screens here,
The Browse Screen:
Here you can see the data that you have already added (if any), the refresh button, sort button, the add button that navigates to the edit screen. There is also a next button on individual records that navigate you to the detail screen.
The Detail Screen:
Here you can see the individual record and all the data associated to it, the delete button that will remove the current record from the CDS, the edit button that allows you to edit and save the changes.
The Edit Screen:
Here you will see a form that allows you to enter the data for all the relevant fields and save those to the CDS. The cancel button on the top left allows you to discard the form and the save button on the top right allows you to save the record in the CDS. Once done, the user is returned to the Browse Screen.
So far, we have created two canvas apps with the Microsoft PowerApps creator studio.
In our next post we will work on the second item: creating a Microsoft Flow to automate a few processes for Ctrade Inc.