PL-100 Microsoft Power Platform App Maker – Create model-driven apps – charts, dashboards, card forms and business rules Part 3
Now in this video, we’re going to have a look at filtering and sorting. So first of all, we’ve got the time period filter here. So you can see if I say last quarter, then this stream changes to the last quarter. If I say this quarter, then it changes again. We have visual filters. So if I load them up, you can see again these visual all filters. These charts are filtered by this time frame. And then if I click on a particular value. So for instance, I’m curious about this $1,937 for redmond. Then you can see it is built up of these four values in these free accounts. And you can see the information about them. And of course, these are cards. So we had to look at how we can edit the cards.
If you saw wish incidentally, you notice that we have got the little image here on the left hand side. So that was the image that we used when setting up this expense. It was the expense receipt. So I’m going to clear this visual filter and I can hide the visual photo again if I so wish to. Then there are global filters. So global filters you can filter on a particular column but there’s nothing set up.
So how do we set it up? Well, we set it up as part of the table definition. So let’s say I wanted to go into the expense table. So home tables name of table. And I wanted to filter on expense value in the advanced options we have got appears in Global Filter in Interactive Experience dashboard. So I want to use this. So I’m going to just check that and click on done.
Now it should point out that not all things can be used. For instance description can’t be used as a text field. Right. So I’m going to now save this table make sure you save it. Otherwise what you have put in won’t actually work. Going to refresh this show global filter. And here we can now see that we can filter on the expense value. And we have got the minimum and the maximum.
Now bear in mind the expense value have not actually restrained the minimum and the maximum. So they are really big figures. So you might want to have some more sensible values than -922,000,000,000 so let’s say I’m going to show the global filter and I want this to be control a to select everything between zero and 62. And now we can see we got some icons we’ve got a clear icon so that resets everything.
So I’ll just do that again up here we have got apply we have again again clear all global photos and save as a reusable photo. So what I’m going to do is apply all global photos. And you can see now, because this is the only one which is shown in the expense value that this is now being filtered. So zero to 62. So what I’ll do again, I will show that and I’ll save this. Maybe zero to 62 is important. So I’ll save as a reusable filter and call it zero to 62.
So there we go. We can now save that. So now it’s saved and you can see it comes up here in the saved photos. So let’s change this. So now this is from ten to 52 and nothing seems to have happened. We still at ten to 62 because it is still there. What I need to do is to clear it and apply it again. So zero or ten to 52, if you find things don’t seem to work, just clear it and start again from the beginning. So now when I go back to my global filter that I previously saved, I can just click on the apply saved photo. You can also see set as default and delete are also options.
So in this video we’ve had a look at filtering, but what about sorting? Well, I can sort here. Currently it is sorted on, modified on and this account is sorted on primary contact. But I could sort it on account name and main phone and modified on and that sort of thing. But here I’ve only got the one particular column they modified on. So why is this? It’s because I’ve not specified any columns to be included into sorting. And again, this is part of the definition. I have got a sortable in interactive experience dashboard, so I’m going to apply that to the expense value. So I’m going to click done save table, takes a few seconds and then when it’s done, I will go back into my power app, I’ll refresh and now when I go in, I can now have a look at the expense value sorting as well.
So that’s how we can sort by expense value and I can sort it descending or ascending. Now, there’s a little icon here with two checkboxes and some text. If I click on that, then I can select items and I can do bulk things to them. So I can delete them or I can activate them. So I change the status to activated or change the status to inactive. A few other things I can share, I can export the selected reports and so forth. And incidentally, just in case you’re wondering, why is this filtered and this is unfiltered? Well, this is filtered because this reacts to this time frame.
So if I go to today, for instance, that will completely disappear. It is filtered, but it is filtered with nothing left. So why is this unfiltered? This is because this is based on the expenses which actually have a date and this is all accounts, which is more of a global thing. It’s the accounts table rather than the expenses table. So this is an expenses drop down. So that’s why all of these visual filters also react to this, because all of these are based on the expenses table as opposed to the accounts table.
So in this video, we’ve had a look at photos. We had to look at visual photos so I can just click on a particular item and see how that’s built up. We’ve had to look at global photos so I can go into a table and say I want to filter by a particular column. And we’ve also had to look at how we can enable sorting to happen from a column. It’s all there in the table. Definition in advance options.
In this video we’re going to have a look at the one thing in this table section that we have not looked at, namely business rules. So business rules allow us to have some sort of logic to the data that we put in. For example, let’s suppose that I say I want you to have to put in a description if a figure is over $100. If not, I don’t even want to see the description field. So here we have our model driven app and we’ve got a description here. Now I put this in the Canvas app, if you remember going back a few seconds to put it in here. But if I was using the model driven app, I might want to say I don’t want to see the description if the expense value is under 100. Well, we can do this with a business rule. So let’s create a new business rule. So I’ll click Add business rule and this loads in a new tab. Now you can see the business rule here. If something, then do something.
And to do something, we can make a recommendation, we can lock or unlock a field. So in other words, I can enable it or disable it, I can show an error message, I can set or clear a field value, I can set a default value, I can say that it is business required and I can set its visibility. So in other words, sure or not sure a particular field. So let’s have a look at the conditions. So I’m going to click on this condition. Well, first of all, let’s name this rule. So I’m going to call this expense $100. I’m going to say, is the expense over or below $100? So that’s my description. It’s just nice to be able to name it. So here we have our condition. So this condition is the expense $100.
Now that’s just the display name. I could put whatever I want there. So the entity is at the expense because I was editing in the expense table. So my rule so in the expense table, is the expense value less than a particular value. You can use a field, you can use a formula, but that gets more complicated than we need. Is it less than $100? So you can see the text view at the bottom. Is the expense value less than $100. Now this is the most important bit. Click the apply button. If you move on to something else, it will not save. So I’ll click on Apply and now you can see if expense value less than 100. Then let’s go back to the components. So then what I want to do is I want to set the visibility.
So we’ve got two little things here. We’ve got a is true and is false. So I’m going to set the visibility so you can see when I’m dragging this in, we have these pluses. So this is where I can drag my components. So I can drag it on top of things as well, but I’ll drag it right here. So here we have is less than 100. So that’s the name instead of it saying New Action. And I’m just going to click Apply, not going to actually fill in everything.
And I’m going to click on Validate. And this validate very useful. It says if I’ve got errors in the process so you can see I haven’t filled everything in and I generally leave the validate on. Certainly do it before you say it because it is very easy to not click the Apply button. So what I want to do, if this is true, then I want the description visibility to be no. Okay, so let’s apply. So now it says if the expense value is less than 100, then hide the field description.
So I’m going to apply that. I’ve already done it, but why not? Now, let’s have a look at the top. Right, firstly, I’ve got save, I’ve got validate and I’ve got scope. So what does scope mean? Scope says where does it apply to now? Entity means a table. So it will apply to everything. It will apply to canvas apps, it will apply to model driven apps. It will apply if you’re using Power Automate. It will apply if you’re using programming using an API. That’s an application programming interface. So in other words, it will apply all the time. Alternatively, you can apply to all forms.
Now, this is all model driven forms, so not canvas apps. So it’s actually the forms. Or you can have it apply to a specific main form. And when I say all forms, by the way, that’s all main forms and all quick create forms. Or you can apply to a specific form, but it’s a specific main form. So I’m going to just leave it to the entity for this. So because I’m not saying narrowing it down to a particular model driven app or form, then I’m saying, okay, it’s the entity.
So it applies when a record is saved or record is created in a canvas app, in a model driven app, in Power Automate, in APIs, or if I even do it in the portal. If I go to Data here, it would also apply here. So if I add a record. So let’s go back. So I’m going to save now saving, yeah, it saves it.
It doesn’t actually make it happen. Notice now I’ve got two additional things I can save as, so I can save it as another file and then I can alter the second rule or I can activate it and it’s only activating that actually makes it do something. So, hey, it’s activating and we got this dialog box saying are you sure you want to activate it? Yes, I’m sure.
So now it is activated and if I go into here and back into business rules and I refresh, we will see that we have got our new business rule with the name Expense 100, it is activated, right? So let’s go back here and we look at zero or 20. So double click on that and you can see description gone. There is no description. So in this video, we’ve created a basic business rule and we can see that it works. However, it needs expanding, as we’ll see in the next video.
Popular posts
Recent Posts