This is the Part 2 of the Microsoft Business Application Platform series.
In Part 1, I talked about problem and in this article I will discuss how we can solve the problem using PowerApps.
First of all, Sign up for PowerApps
Creating an Environment
The latest version of PowerApps includes support for Environments. You can create different environments for your DEVELOPMENT, TEST, UAT, and PRODUCTION environments.
To do this, we need to open the Admin Center – https://admin.powerapps.com
Click on + New Environment button.
Enter a Name, select a Region, tick Create a database for this environment checkbox, select an access level, and click Create an environment button.
Note: If you the Create a database for this environment checkbox untick the database for the Environment will not be created. But don’t worry, you can create this later.
Managing Common Data Service
Now we can start creating and updating Entities in Common Data Service from https://web.powerapps.com
You can switch environment from the top menu.
Create an Entity and Fields
If your database in CDS is not created, you can create it as below.
Click Common Data Service > Entities
Click Create database
A database will be created based on the standard Common Data Model (CDM).
Once the Entities are created, it’ll look like this.
For our PowerApp, we could use one of the OOTB entities such as Case. But to demonstrate how to create a new entity and fields, I am going to use a custom entity.
To create an Entity, click on + New Entity button.
Populate the required fields and click Next.
By default, 5 system fields will be created.
The custom entity is now created. Click on the … to see some of the available actions. You can;
- Open Entity in Excel
- Import and Export Data
- Export Template
- Duplicate Entity
Now we can create some new fields.
Click on the newly created custom entity Maintenance Requests.
Click Add Field button.
Populate the Display Name, Title, and select a Type. Currently, below types are included.
- Multiline Text
In this example, I have selected Text type. Click Save.
Create all required fields.
Create a PowerApp
Now that we have an entity to store data, let’s create a PowerApp.
Click on the + New app button.
You can create a PowerApp using two different tools.
- PowerApps Studio for Windows
- PowerApps Studio for Web
In this example, I am going to use PowerApps Studio for Web.
The direct link to the PowerApps Studio is https://create.powerapps.com/studio/
You can start creating a PowerApp multiple ways. You can start from scratch or from a data source. In this example, let’s start from Common Data Service data source.
On the Common Data Service tile, click on the Phone Layout button.
Select the Entity we just created and click Connect button.
PowerApps Designer launches. PowerApps will automatically build a 3 screen app for you. PowerApps Designer looks like a cross between Excel and PowerPoint. On the left hand pane, you can create screens. On the top there’s the Formula Bar. Left of the Formula Bar, you see the Property drop-down list which shows properties of the selected control. In the middle you have the Design workspace where you can design each screen.
You can now test your PowerApp by clicking the PLAY button on the top right. You can create records, view lists of records, and edit records. So far, we haven’t written any code or even written any formulas.
In Part 3 of the series, I’ll be customising this PowerApp with branded styles and more screens.
You can watch the below video Create your first app using CDM | Microsoft Common Data Model from MS PowerApps to see the steps in action (Note: There may be slight differences due to updates to CDS and PowerApps)