Common Data Service and Power Apps. Creation of a mobile application

Hello! Today we will try to automate the process of creating orders using the Microsoft Common Data Service data platform and the Power Apps and Power Automate services. We will build entities and attributes based on Common Data Service, use Power Apps to create a simple mobile application, and Power Automate will help to connect all components with a single logic. Let's not waste time!







But first, a little terminology. We already know what Power Apps and Power Automate are, but if suddenly someone is not in the know, I recommend that you read my previous articles, for example, here or here . However, we have not yet analyzed what the Common Data Service is, so it's time to add some theory.







Common Data Service (CDS for short) is a data storage platform like a database. Actually, this is the database located in the Microsoft 365 cloud and has a close relationship with all Microsoft Power Platform services. CDS is also available through Microsoft Azure and Microsoft Dynamics 365. Data can enter CDS in various ways, one of the ways, for example, creating records in CDS manually, similar to SharePoint. All data in Common Data Service is stored in tables called entities. There are a number of basic entities that you can use for your own purposes, but you can also create your own entities with your own set of attributes. Similar to SharePoint, in Common Data Service, when creating an attribute, you can specify its type and there are a huge number of types.One of the interesting features is the ability to create so-called "Sets of parameters" (analogous to options for a field of type Selection in SharePoint), which can be reused in any field of the entity. Plus, data can be loaded from a variety of supported sources, as well as Power Apps and Power Automate streams. In general, in short, CDS is a data storage and retrieval system. The advantage of this system is tight integration with all Microsoft Power Platform services, which allows you to build data structures of various levels of complexity and use them in the future in Power Apps applications and easily connect to data through Power BI for reporting. CDS has its own interface for creating entities, attributes, business rules, relationships, views and dashboards.The interface for working with CDS is located on the websitemake.powerapps.com in the "Data" section, where all the basic possibilities for configuring entities are collected.

So let's try to customize something. Let's create a new entity "Request" in Common Data Service:







As you can see, when creating a new entity, you need to specify its name in single and multiple values, and you also need to specify a key field. In our case, this will be the "Name" field. By the way, you can also note that the internal and display names of entities and fields are indicated immediately on the same form, unlike SharePoint, where you first need to create a field in Latin, and then rename it to Russian.

Also, when creating an entity, it is possible to make a huge number of different settings, but we will not do this now. We create an entity and move on to creating attributes.

Create a Status field of the "Set of parameters" type and define 4 parameters in the context of this field (New, Execution, Completed, Rejected):







In the same way, create the rest of the fields that we need to implement the application. By the way, the list of available field types is listed below, agree, there are obviously a lot of them?







Pay also attention to the setting of the required fields, in addition to "Required" and "Optional" there is another option "Recommended":







After we have created all the necessary fields, you can look at the entire list of fields of the current entity in the corresponding section:







The entity is configured and now you need to configure the data entry form at the Common Data Service level for the current entity. Go to the "Forms" tab and click "Add Form" -> "Main Form":







Set up a new form for entering data through the Common Data Service and line up the fields one after another, then click the "Publish" button:







The form is ready, let's check its work ... We return to Common Data Service and go to the “Data” tab, then click “Add Record”:







In the form window that opens, enter all the necessary data and click “Save”:







Now in the “Data” section we have one record:







But few fields are displayed. It's easy to fix. Go to the "Views" tab and open the very first view for editing. Place the required fields on the submission form and click "Publish":







Check the composition of the fields in the "Data" section. Everything is fine:







So, on the side of the Common Data Service, an entity, fields, data presentation and a form for manual data entry directly from CDS are ready. Now let's make a Power Apps canvas application for our new entity. Let's move on to creating a new Power Apps application:







In the new application, we connect to our entity in the Common Data Service:







After all the connections, we set up several screens of our Power Apps mobile application. We make the first screen with a little statistics and transitions between views:







We make a second screen with a list of available orders in the CDS entity:







And we make another screen for creating an order:







Save and publish the application, and then launch it for verification. Fill in the fields and click the "Create" button:







Check if a record has been created in CDS:







Check the same from the application:







All data is in place. The final touch remains. Let's make a small Power Automate flow that, when a record is created in Common Data Service, will send a notification to the task executor:







As a result, we have made an entity and a form at the Common Data Service level, a Power Apps application for interacting with CDS data and a Power Automate flow for automatic sending notifications to executors when creating a new order.



Now about the prices. Common Data Service is not included in the Power Apps that come with your Office 365 subscription. This means that if you have an Office 365 subscription and Power Apps is included, then you won't have Common Data Service by default. Access to CDS requires purchase of a separate Power Apps license. Prices for plans and licensing options are listed below and are taken from powerapps.microsoft.com :







In the following articles, we will look with you even more features of Common Data Service and Microsoft Power Platform. Have a nice day, everyone!



All Articles