Creating a Canvas Power App from scratch using Common Data Service
What are Canvas Apps in Power Apps?
Power Apps allows you to create apps on a canvas without writing a code in traditional programming languages like C#. Instead, Power Apps allows you to design and build apps on canvas by dragging and dropping UI controls/elements, in the same manner how you design a slide in PowerPoint.
You can specify logic and working with data in a formulas which are Excel like expressions.
You can specify logic and working with data in a formulas which are Excel like expressions.
Using Power Apps, you can connect to your business data that is stored either in underlying platform(Common Data Service) or in various online and on-premises data sources like SharePoint, Excel, Office 365, Dynamics 365, SQL server etc.
What is Common Data Service(CDS)?
Common Data service is a service which allows you to store and manage your data used by business applications. Data in common data service is stored within entities. An entity is a set of records used to store data, similar to how tables stores data in database.
To make it simple, Imagine CDS as DBMS, Enities as Database and Entity as Table.
Common Data Service includes basic set of entities which are commonly used like Accounts, Contacts, Appointment, Task, Email etc, but you can also create your custom entities specific to you organization and populate them with data using Power Query.
Create a CDS environment
If you don't have CDS enabled environment. Follow following steps to create one.- Create a new environment by clicking on Create a new environment button available under Data > Entities menu in left navigation. You can even create a new environment from the PowerApps admin centre.
- Specify environment Name, Region and Type.
- Once environment is ready, Click on Create Database button.
- Specify the currency and language for your database, Select Include samples and data option.
- Once database is ready, you can see the list of standard entities created for your environment.
Create a blank app
- Login to Power Apps.
- Select Canvas app from blank.
- Name you App, select Phone format and click on Create.
- Click on Connect to data on canvas.
- Select Accounts entity from data sources.
- Select New Screen option under Home tab.
- Select List screen. This will be our List/Browse screen where all accounts will be displayed.
- Point Gallery control data source to Accounts by selecting Gallery control in left navigation tree view and then setting the value of Items property to following formula. Also select Gallery layout to Title only.
- Add an Form screen. These will be our Create and EDIT form screens.
- On the Form screen, Select form DataSource property of form to Accounts and its Item property to BrowseGallery.Selected. This will point the form control to Accounts entity and in EDIT mode it will display the data of selected account from Gallery control.
- On Browse screen set the OnSelect property as follows. This will open the New Form on selecting plus icon.
- Set OnSelect property of first right-arrow property as follows. This will open EDIT form for selected account.
- On Form screen, set the OnSelect of check-mark icon as follows. This will save the form changes and then navigate to Browse screen.
- On Form screen, Add trash icon from Insert menu
- Set the Trash Icon's Color property to White and its OnSelect formula as follows. This will delete the selected account.
- On Form screen, Set the OnSelect as follows
- Test the app by clicking on Play icon in top right corner. You can play and test CRUD operations.
Comments
Post a Comment