Saturday, March 11, 2017

Consuming custom common data model entity in powerapps

In the previous post we saw how we can create a new custom entity in common data model. In this post let's do a quick walkthrough of how we can consume it in powerApps and create/update data for that entity from powerapp. 

In the bottom left corner of the powerapp portal you will find the button to create a new app

Select if you want to use the powerapps studio for windows or the powerapps studio for web to create the new app. In this example I choose Powerapp studio for Web

Microsoft provides out of the box templates for creating apps. Let's create a simple phone layout app for connecting to CDM database via Common Data Service 

You will land on the connections page. Here we can see the CDM database we created in previous post. Once you select the CDM DB then you can see the desired entity . Notice we can see our custom "Approved vendors" entity

Click Connect

The app building service will run and take around a minute to build a default app for the selected entity

You will land in the designer window of the created app. The system created a basic 3 page app (based on the template we selected) to view and edit the data of the entity and also shows the data in the preview.  

We can navigate to different pages to see how it looks

Now let's save the app on the cloud, to do this go to  File -->  Save as --> Select the cloud option and give it a name and save it

Once this is finished you can access the app from other devices.
I installed powerApps on my Android phone and logged in. The new app was visible under My apps.

On opening the App I can view the data on my mobile phone.
Below are screenshots from my mobile

Notice that the vendor ID field shows the lookup by fetching the data from the CDM vendors entity

   Once the record is saved we can edit it again

We can go back to CDM database and view the data of the entity.  The new records we created from the App is visible here.

Users can build their own apps without writing a single line of code by leveraging the out of box available templates. Store them on Cloud and share with other users of their company.
This is a big game changer as smart users can now leverage all the tools and power from the cloud to be more productive and use the systems in much powerful and smarter ways.

Saturday, March 4, 2017

Common data model entities - overview

The Common Data Service is a cloud base business application platform. This platform provides a rich and productive development platform though Common Data Model which is a store of common business entities like customers, vendors, purchase orders, products and many more.
There are integration capabilities for importing data from multiple sources like Dynamics 365 for sales, Dynamics 365 for Operations, any other business application or data source. We can also create our own new custom entities and establish relation with existing entities. 
Common data model also act as a a platform for powerusers to leverage the tools like Power BI, Powerapps and Flow to Meausre, Act and Automate the business data. These are the three key objectives on which the whole new Microsoft innovation is based on.   
Lets do a quick walkthrough on creating a new entity in common data model and then publishing data in this entity from excel followed by exporting this data from CDM.
When you login to powerapps portal you will need to first create a new environment to access the CDM entities. To know more about environment refer to working with environments .
To create your own enviroment in powerapps portal click on the "get started" button
Click on create new environment and give a name and select a region. It takes around a minute to setup the new environemnt and once it is done you can see that your current environment is set to the one which you created.
Now we can view the available entities from the Entities button on the left hand pane . CDM ships around 60+ entities. The details of all the entities and there relationship can be found in the whitepaper available at CDMEntityReference document
To create a new entity click on "New entity" button and give it a name. Let's call it "Approved vendors" and enter a  description and click next. You will observe it is a very nice self guided experience.
Once the entity is created, it is visible in the list of entities.
Lets add new fields in this entity. To do this, click on "Add field" and enter the details. Let's call it Vendor approval code.
We can also specify additional properties as highlighted below.
Once the field is created, it is visible in the list of fields in the entity.
Now let's create a new field which is linked to the existing vendor entities. To do that we can go to relationship tab.
Add a new relation with the existing vendor entity.
Now you can see that the vendor ID is visible on the entity fields. The type of this field is a lookup due to the relationship created for it.
At this stage as we have only created the entity schema, there is no data in the entity. This can be seen from the "Data" group as shown below
Now we can open this entity in excel by clicking on the "open in excel" button. The powerapp office add-in will also load.
Here we can start entering the data. You will see that the add-in automatically pulls the current data in the related field of vendor ID.
After entering the data we can publish it to CDM by using the publish button.
 Once the data is published in CDM we can see the notification in the add in.
Lets go back to CDM portal and view the data in the entity.
Upon refreshing, the data we published from Excel can be seen.
We can also export data of  the current entity by clicking on export data button.
Once the data is exported you can download the package
In the package you get a csv file and 2 XML files as below.
Data exported in the csv file as shown below.
As you see, Microsoft has done an amazing job in making the whole experience self guided so that the CDM platform can be leverged by a large number of professionals and not just developers.