{"id":5556,"date":"2022-01-07T15:51:36","date_gmt":"2022-01-07T14:51:36","guid":{"rendered":"https:\/\/blog.prodwaregroup.com\/nl\/?p=5556"},"modified":"2023-07-06T11:49:52","modified_gmt":"2023-07-06T11:49:52","slug":"how-can-you-harness-the-full-potential-of-microsoft-power-apps","status":"publish","type":"post","link":"https:\/\/blog.prodwaregroup.com\/nl\/microsoft-ecosysteem\/power-platform\/how-can-you-harness-the-full-potential-of-microsoft-power-apps\/","title":{"rendered":"How can you harness the full potential of Microsoft Power Apps?"},"content":{"rendered":"
Microsoft positions Power Apps as a Low Code platform for creating Apps. Power Apps is part of the Power Platform<\/a>, which includes Power BI, Power Automate and Dataverse, all Low Code solutions.<\/p>\n On the other hand, Microsoft is also advocating for Fusion Development teams<\/a>. These are teams that consist of citizen developers, consultants, but also .Net and Web developers. The type of developers that are normally not focused on Low Code but create High Code solutions.<\/p>\n In this article we look at Microsoft Power Apps<\/a> and the range of possibilities it offers in its toolbox. Plus, what you can do with Low Code development and what the \u2018upgrade\u2019 paths are, including High Code solutions, to create an App that meets your requirements.<\/p>\n Let\u2019s start with a Model-driven app. This is the most Low Code app that is available in the toolbox. As the name implies, it is driven by the model. In this context that means the data model of Dataverse. So, the model we create in Dataverse drives how our App behaves. Dataverse gives us the first extension point for our App.<\/p>\n A Model-driven app consists of a menu, or sitemap as it is called. Each menu item is linked to a Page. There are three kinds of pages: Dashboards, Tables and Canvas Pages. So, for each menu option you can decide what is the best kind of page to fulfill the requirements.<\/p>\n With Dashboards it is possible to create overviews of your data to quickly access it. Or you can add charts and graphs for a visual representation.<\/p>\n Tables are direct views on your tables in Dataverse. In Dataverse you can design how the data is represented in lists and forms. Forms have some interesting extension points for custom UI controls.<\/p>\n Last is the Canvas Page. You may have heard of Canvas Apps in the context of Power Apps. Canvas Pages is Canvas Apps, the only difference is that instead of a complete App it is just one page. With Canvas Pages we can create a custom UI to interact with the data. This is also the last extension point we look at.<\/p>\n Dataverse used to be known as Common Data Services. Dataverse lets you securely store and manage data that’s used by business applications.<\/p>\n I would almost say the possibilities of Dataverse are endless. There are many options you have in order to create a model that works for you. Most of these things are \u201cNo-\u201c or \u201cLow-code\u201d options. Let\u2019s quickly cover the essentials.<\/p>\n The basics are of course the ability to add columns of all usual types (text, number, yes\/no, combo boxes, etc.) and add relations to other tables.<\/p>\n Let\u2019s just look at the more interesting features that are available to change the behavior of your app:<\/p>\n Next you can run Power Automate<\/a> flows. These Flows are triggered when records are created or changed. You can then run more complex calculations or change data in related entities as well. The big selling point of Flows is also that they can easily integrate with other systems and data sources. So you can easily extend your app with the data of other systems.<\/p>\n Developing flows still falls under the Low Code acronym, but it contains an expression language that is crucial to understand for most use cases of Power Automate. So some developer insight is preferred.<\/p>\n The flows always run after the record has been saved, i.e. the flows runs asynchronously. So do not depend on a flow to \u2018fix\u2019 your data. If the Flow fails for some reason the data is not updated. At the moment that you save the data it needs to be valid.<\/p>\n Sometimes it is needed to run Business Logic synchronously. So, make changes to the data while it is being saved, e.g. when it is saved everything is in the correct state. For simple logic, Business Rules on the table can be used and will be sufficient. But for more complex scenarios we can use Plug-ins.<\/p>\n Plug-ins are created using C#\/.Net. They can be configured to run at different moments to execute custom code. This code runs inside Dataverse as part of its processing. This means that we can create logic that amends or validates data before a record is saved. And also prevent invalid data from being saved when something is wrong.<\/p>\n Plug-ins can also be used to add new Actions to an entity. Normally you have \u201cnew\u201d, \u201cupdate\u201d, \u201cdelete\u201d etc. But maybe you have a specific action, like \u2018Clone\u2019, that needs to be specifically programed. That is also possible using a Plug-in. This action can then be connected to a Command button on the Ribbon of a Form.<\/p>\n For that reason Microsoft has introduced the Power Apps Component Framework (PCF). With this framework it is possible to build Custom UI components. These components can then be added to your Forms. Any field on a form can be changed to another component. This gives great control over the look and feel of your app.<\/p>\n There are many pre-built components out there. The most important source to know is the PCF Gallery<\/a>. This is a curated list of components that are ready to be downloaded and used. Even better: most of them are free to use.<\/p>\n Of course, there are scenarios where you need your own custom UI element. Something that caters directly to your business needs, perhaps. Using the PCF, new UI controls can be created. In the PCF Gallery there are many open-source components, those can be used as starter for your own.<\/p>\n The Components are created using TypeScript (which is comparable to JavaScript), html and CSS. These are typical techniques that are used for web development. A web developer will feel right at home creating a custom component for your app.<\/p>\n Using UI Controls we can change the look, feel and behavior of one field on our form. But maybe we want to have application logic that encompasses the whole form. For example, show a warning on the form if a related entity has a problem.<\/p>\n In that case we can utilize JavaScript. The JavaScript can be loaded into the form and can be executed when the form is loaded or saved, or when data changes are made on the form.<\/p>\n So, we have learned two possibilities of Dataverse and how to extend the UI of model-driven Apps. But what if the Model Driven App UI is just not right for the job? Then we get into the realm of Canvas Pages.<\/p>\n The editor of canvas pages lets you create whatever UI you can imagine, but within limits. The Canvas toolbox consists of all kinds of standardized UI controls that can be used to build your UI. On top of that there is the expression language, Microsoft Power Fx<\/a>, to program in.<\/p>\n If the default UI components are insufficient to build your app it is again possible to use PCF components to extend the possibilities. In the PCF gallery you can search for components built specifically for Canvas apps. There are fewer controls for Canvas than for Model driven, so the chance is higher you will need to develop your own component sooner or later.<\/p>\n Last but not least is the \u2018nuclear option\u2019. Let\u2019s imagine that with all the tools above it is not possible to create a UI with the required logic that matches your requirements. Your Model Driven app consists of many pages, probably many pages can be created using the techniques described above. But maybe there is this one complex page that cannot be done.<\/p>\n In that case we can develop a custom web page. This is basically a stand-alone web app, for example hosted in Azure. We can use iframes to load our app seamlessly into the Model Driven page. Plus, Dashboard pages and Entity Forms have the possibility to add an iframe out of the box.<\/p>\n Using a Dashboard with your web app does not need to have context. Or Forms when the context is important. Imagine selecting a record from a list which opens in the Form where the only item is your web app. In that case the app knows which entity and record has been opened.<\/p>\n Obviously now you can go all out in creating your UI and logic for the application. There may be a back-end server that can execute complex business logic. Dataverse has comprehensive APIs so the back-end can still integrate with all the data and logic that is already available there.<\/p>\nWhat is a Model-driven Power App?<\/h2>\n
<\/p>\n
What is Dataverse used for?<\/h2>\n
How creating a Table in Dataverse supports data integrity<\/h3>\n
\n
The benefits of running Power Automate flows<\/h3>\n
When and how to add Business Logic within Dataverse<\/h3>\n
How Power Apps allows us to change the UI behavior for better user experience<\/h2>\n
\nThe possibilities of Dataverse give us many tools to make sure our data is OK and adds additional logic to this. However, the end user will see the UI of the App and interact with that. By default there are standard representations of data, but sometimes we want something different. Maybe we want 5 stars to indicate a rating or to integrate the address with a postal code check.<\/p>\nHow do you use components in Power Apps?<\/h3>\n
Creating your own PCF Controls<\/h3>\n
Adding Application Logic<\/h3>\n
Microsoft Canvas Pages as an alternative to model-driven apps for creating a user interface<\/h2>\n
PCF components in Canvas Pages<\/h3>\n
Beyond low-code \u2013 when are Custom developed pages relevant?<\/h2>\n