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

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

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

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 Common Data Service is, so it's time to add a little theory.

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

Common Data Service (CDS for short) is a data storage platform like a database. Actually, this is a database located in the Microsoft 365 cloud and having a close relationship with all Microsoft Power Platform services. CDS is also available through Microsoft Azure and Microsoft Dynamics 365. Data can get into CDS in various ways, one of the ways is, for example, manually creating records in CDS, similar to SharePoint. All data in Common Data Service is stored in the form of 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 sets 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 "Option Sets" (similar to options for a field of type Choice in SharePoint), which can be reused in any field of an entity. Plus, data can be loaded from a variety of supported sources as well as Power Apps and Power Automate flows. 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 later 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 website make.powerapps.com in the "Data" section, which contains all the main features for setting up entities.
So, let's try to set something up. Let's create a new entity "Assignment" in Common Data Service:

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

As you can see, when creating a new entity, you must specify its name in single and plural values, and you also need to set the 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 proceed to the creation of attributes.
We create the Status field with the "Set of parameters" type and define 4 parameters in the context of this field (New, Execution, Executed, Rejected):

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

Similarly, we create the remaining 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?

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

Also pay attention to setting the mandatory fields, in addition to "Required" and "Optional" there is also the "Recommended" option:

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

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

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

The entity is configured and now it is necessary 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":

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

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

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

The form is ready, let's check its work. We return to Common Data Service and go to the "Data" tab, after which we click "Add Record":

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

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

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

Now in the Data section we have one entry:

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

But few fields are displayed. This is easy to fix. Go to the "Views" tab and open the very first view for editing. We place the required fields on the submission form and click "Publish":

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

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

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

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

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

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

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

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

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

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

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

And we make another screen for creating an order:

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

We save and publish the application, after which we run it for testing. Fill in the fields and click the "Create" button:

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

Check if an entry has been created in the CDS:

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

Let's check the same from the application:

Common Data Service and Power Apps. Creation of a mobile 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 the Common Data Service, will send a notification to the task executor:

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

As a result, we have created 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 automatically sending notifications to performers when a new order is created.

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

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

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

Source: habr.com

Add a comment