Skip main navigation

Application Fundamentals Overview

Microsoft Dynamics 365 and the Power Platform
17
We’re now ready to dive into a little bit more details about the Canvas applications. In the prior practise, you actually created the Canvas application that we’re going to be building out through the practises in this module. But we want to dive into some of the fundamentals and cover that before we turn you loose to actually go work on the application we’re building. A good place to start is a little discussion around the life cycle of a PowerApps Canvas application. One of the things that you’ll see is it’s very visually designed. And you’ll work with the Visual Designer to go through it, build out the elements.
47.4
One of the things that’s nice about Canvas applications, they lend themselves really well to going through iterative development of it. If you feel like you have to have it all done in the first release, step back and take a moment to think about how you could get the minimum viable application out to your users, get the feedback, and go through the process. Oftentimes, it goes through the four stages that I have on here. The visual design– you set it up. You build the initial application. You save and publish it. Sharing is how you make the application available to one or more people in your environment. They’ll run the application, give you some feedback on it.
82.3
And you go back through this process on an iterative basis. That’s the general lifecycle of a Canvas application. The PowerApps Visual Designer is where you’ll be spending most of your time building the application. This is where you lay out the screens, build new screens, set the properties on controls, look at App Checker to see what problems you might have, accessibility issues that you might need to render, and even go ahead and play the application and preview it while you’re doing– building the application. That’s one of the nice things. In fact, you can hold down the Alt key and press one of the buttons or actions.
114.9
And without even jumping into the full preview mode, you can see the application respond and interactively take the action that you’re trying to perform. It makes it a lot easier to actually develop and debug the application as you’re building it. As you make changes, you’re seeing the live data that you’re connected to. You can see on my screen the CO2 absorbing artificial trees. If I were to move that around, I would see the results of that. If I were to click on drill down with the Alt key, it would take me to the next screen to be able to do the next action.
142.7
If I made changes to things like colours or other cosmetics on the application, I would see those immediately reflected. I can move around the application using the tree on the left-hand side. That tree shows the control tree of all the screens and the controls on it. That’s a quick way to go and jump to that particular control without having to hunt around to find it on the screen surface. It also allows you to right click and do actions on those individual controls, even rename them. And that’s one of the tips I’ll give you. It’s a good idea as you’re putting controls on. You’ll get names like text box 1.
174.6
What you’ll want to do is right click on it in that tree navigation and give it a meaningful name to reference later on as you build formulas and expressions that use that. Now let’s talk about some of the core concepts of a Canvas application. The first one I want to cover is screens. Screens are fundamental. You have to have at least one screen. This is what the user interacts with and contains the controls that you’re going to have the user do their work with. You can see on my example here I’ve got a detail screen as well as a browse screen. You can have multiple screens. And, oftentimes, applications have several. They may have one for an edit form.
209.8
They have one for a view form. They may have certain drill-down lists. It’s up to you to orchestrate how you want the user to move between the different screens as they perform the actions in your application. Now, expressions are how you get things to happen. So you can see here in this example, I’ve highlighted the next arrow. That’s the little icon that’s on the right side of the information on my screen. When that happens, it goes up to the different events. You’ll see that I have the OnSelect event highlighted here. And I’ve chosen the function that I want to perform, which is Navigate.
242.6
So what I’m telling it to do is when the user clicks that form or selects it as the event that occurs, I want to navigate to the DetailScreenI, which is my detail screen for drilling down on the account. The None is actually a transition. So you’ll see that you can have different transitions if you want fancy fly-ins and things like that. I tend to be very simple and use None most of the time. But you have some options if you want to do that. And you’ll notice as you’re typing navigate in– and you’ll see an example as I get a little further in– you’ll get some intellisense or hints of what the parameters are.
277.5
So I don’t have to remember None. I get some nice options that I can choose from without having to remember all the details for all the functions I might want to use. The other core concept to be aware of is controls. Controls are what you put on the screen surface that the user actually does the interaction with the live data on, things like buttons, dropdown lists, combo boxes. Galleries are lists of data. We’ll see those in the practises as you’re working through things. Data table is a quick way to visualise it it’s almost like a grid in the model-driven application giving you that grid-like look at the data.
311.2
Forms are very much for displaying fixed data almost similar to the model-driven concept of a view of a record, as well as an edit form. There’s two separate forms. Those forms are used for creating new records, you’ll see that also in one of the practises later on. And the media controls give you ways to show everything from an image to files and other things like that that you can pull in to your application. Now, expressions can go from basic to more complex. We saw a very simple example in my prior one where I navigated to the detail screen. And that’s similar to the one here although I’ve made it a little bit more complex.
349.2
When the OnSelect occurs, in other words, somebody pushed a button to navigate, I’m also going to do a new form here. So what that does is reset EditForm1 and then does the Navigate. You’ll notice that I’ve got those two in the expression window. So I’ve chained them together. So it’s going to first run NewForm to clear out the form so it’s ready for use, and then it’s going to navigate. And you can see with the complex formulas that I build these out and chain these together to get a more complete evaluation of what I want to do for the business logic in the application.
381
Now, as the formulas get real complex, you can get somebody else to build them for you. I’m only joking there. Oftentimes, especially functional consultants may have some help from developers in creating more sophisticated ones. But you can also build them in here really easy. You can drag down the editing window. You’ll see a bigger space like I have on the lower part of my slide here. You’ll see this is a more complex function doing sort by call search, has an if built in to it. Now, this could be all one line, but you can also hit the Format Text to quickly format it as nice readable.
413.6
When you’re trying to understand an application that has more complex formulas, that’s what you’re going to want to do to quickly be able to comprehend what they’re trying to do. Like everything in most editors, there’s multiple ways that you can work with things. In this case, I’m looking at control properties. So if I had a text input box, it has a default property, that default property is an input only, which means it’s intended to be set, not a way that I can get data out of it. I had a couple of ways I can go set the default value on it. You’ll see in the expression window there, I’ve provided text input as the default.
445.7
I could also on the right-hand side, while I have that control selected, I see a more complete property editing box that will show me the properties, the rules that are built against it, as well as any of the advance settings on that particular control that I can go set. But different properties have different characteristics. For example, the text input box default is an input-only property.
467.4
If I were to take a look at the field property on the text input box, that is an input-output, which means not only can I use it to give a value to it, I can also use it in other places as an output property, meaning I can use it to combine with other properties to set it. So for example, I might reference it to set the fill on another control, just have consistency in the fill colour that I choose between the two options. The other type of property is an output only. So these are intended for you to get the value.
499
So if we were to look in the dropdown box that has default on this example and try to look for text, we wouldn’t see it because it’s an output only, not something that we can assign or do a complex formula to assign a value to. It’s output only. And a final one I want to talk about are the behaviour formulas or OnSelect, OnVisible, OnStart. We’ve seen how OnSelect works. So that is an event that occurs. So think about these as when a characteristic or event occurs on the button or the control, these are ways that you can react to that. OnStart is a special one we’ll see in applications.
532.2
When the application starts, you can have some expressions that run to do things like load data initially. In fact, we’ll do that in the practise that you’re going to go through. Another concept you should be familiar with when building an app is keeping track of progress or as I like to think of it as the scratchpad or the whiteboard that you get to use to write things down in the application to remember when you get to another screen or another action to have that value saved so you don’t have to do the operation again. The first type of variable we have are global variables. You use the set function. So in this example, I’m saying Set CurrentName equals George.
566.1
If I wanted to change the value to Dave, I’d say Set CurrentName to Dave. In the application, I can reference that in expressions by just saying CurrentName. So I could set the default value to CurrentName. And it would set the name of that text box to George. Now, those global variables, like they sound, global are application-wide scope. So they are available from the different screens to be able to work with. Context variables are a little bit different. Context variables are only available to that local screen. Now, one of the nice things you can do is when you navigate, you can use update context to pass things on to that next screen and make it available.
601.3
When you get from summary page to a detail page, that context variable would be available. And the final one that you should be aware of are collections. Collections are a list of records that you can temporarily use in memory. They’re nice because you may be adding several records all at once, and you’re not ready to commit that to the data source. You could put those in a collection. You’ll also see in the application where we load some things into the collection so it’s available later in the application when we work through the practise. Now, these collections can also be saved to the local device using the SaveData function or the LoadData to restore them back in.
638.6
Now, we’ve hinted at it, but I want to drill down just for a second into how we actually work with data and services. And that’s all done through connectors. Connectors are the lifeblood of a Canvas applications ability to reach out to external services. You’ll see how to use this with CDS as we go through the practise where we’ll use the connector to load up data as well as commit data back to the CDS database.

In the previous step, we assessed your knowledge of Building Model-Driven Applications. In this step, we dive into a little bit more details about the Canvas Applications.

Canvas Apps Core Concepts

Screens are fundamental. You have to have at least one screen. This is what the user interacts with and contains the controls that you’re going to have the user do their work with.

Expressions are how you get things to happen. Controls are what you put on the screen surface that the user actually does the interaction with the live data on, things like buttons, dropdown lists, combo boxes. Galleries are lists of data.

Forms are very much for displaying fixed data almost similar to the model-driven concept of a view of a record, as well as an edit form.

And lastly, Connectors are the lifeblood of a Canvas application’s ability to reach out to external services.

Join the discussion

Now that you understand what goes into creating a canvas application, we will build on that further during the practice session. Often the canvas app goes through four stages on the PowerApp Visual Design which are – set it up, build the initial application, save and publish. From the four mentioned, which do you think is most crucial to the process and why?

Use the discussion area below to let us know your thoughts. Try to respond to at least one other post and once you’re happy with your contribution, click the Mark as complete button to check the Step off, then you can move to the next step which is Working with Data Sources.

This article is from the free online

Dynamics 365: Using Power Platform Applications

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education