PL-100 Microsoft Power Platform App Maker – Create model-driven apps – views Part 2

  1. 43. Saving and loading data records into views

In this video. We’re just going to have a quick look around and see what else you can do in views. Well, you can group, so you can group on a particular description or an ID, or when it was created or currency. For instance, you can use this at the bottom to narrow down what you’re looking at. So maybe you’ve got the equivalent of a file effects used to be in the 1990s and 2000 thousands.

So look for all surnames beginning with the letter G. For instance, if you have enabled the editable grid, you can show this. So click on Show as and you can say I want to show this as a read only grid. So double clicking on it gives me one of the forms, whereas if I go to the editable grid and clicking on it, this allows me to edit it. Now clicking on Share up here, this is another way of sharing your view. We had to look at that right at the end of the previous video, so we can delete so individual items.

There may be more options available with this drop down. We can add new items, we can show a chart. So this shows a chart over here. We’ll be looking at charts very soon. We can search for items. So we’ve got a Find icon, search icon up there. So this is probably more useful if you say it went to the accounts and I’ll go to all accounts and maybe I’m looking for the word Adventure.

So there we can see the account. Adventure works, we can run flaws. So when we go into Power Automate, you’ll be able to create a floor or run a floor from here. You can refresh the data, you can email a link to the data and you can export to Excel. So what I’m going to do is I’m going to export this file to Excel and here’s the file so you can see the information.

What I’m going to do first of all is I’m going to go to my Personal View 79 and export this. So previously we only had the two columns exported because that was all which were in the view. Now you can see we’ve got four. So what I’m going to do is I’m going to use this table to create a new number. It could new expense. So this is a moderate amount and I’m going to make this $60. So this is within the requirements of my Personal View, greater than ten, less than $79. So I’m just going to save that and then I’m going to import from Excel.

There are options available by the way, so you could open in Excel online, for instance. So exactly the same thing, it’s just in the web browser. So what I’m going to do is I’m going to import it from Excel. Not going to import a CSV or XML though those are options. So now I need to choose the file upload. So it is this file. Click Open. You will then need to select your primary key.

You should select the ID. In this case, I’m going to show you what can really go wrong if you don’t. You can allow duplicates or stop duplicates from happening. But instead of clicking Finish Import, what I really suggest you do is go to review mapping, and then you can see what’s going to happen with your data.

So created on that. This isn’t something that I can set. It’s something that the computer manages. So it’s going to ignore it. It’s not going to import anything, but you can see ID description and expense value. It is going to import. So I’m going to click on Finish Import. And you can see your data has been submitted for importing. In other words, it’s not actually happening right now. Right this second, if I click Track Progress, you can see what’s happening here’s a couple of tests I did earlier. It is currently passing. It is currently working out where a field stops and starts. You’re just interpreting it. It’s now transforming the data, getting it into the format that it needs. And now it’s completed with one success. So if I go back in here previously, we just had two items. If I click Refresh, we still have two items. But one of our expenses has actually been deleted.

So this is really important that you should be aware of this. Make sure you know what you’re doing. Make sure you’ve got backups. So what I should do, if I didn’t want that to happen, is set an alternate key. So the alternate key being ID. So here I would be saying, well, we’ve got these two items. You exported these two items. I’m going to import these two items, but not necessarily going to be the same two items. So I would be very careful when using this import from Excel. It can, if you’re not too careful, delete some of your existing data. At the very least, take a copy of what you’ve got. So what you might feel safer with is exporting this to Excel and instead of deleting what’s there, appending to the end. So here is my new item. So this is a small amount for $10.

So save that import from Excel, choose the file, click Next. Don’t allow duplicates, have an alternate key as my ID. Review the mapping, click on Finish Import. Wait a few seconds, and then go to refresh. And there is our item again. So be really careful with the export and import. I’ve just shown you that it can get out of your control very quickly. So just import it at the end, any new data, add it, append it to the very end of the spreadsheet, and make sure you’ve got backups. I take no responsibility for any deleted data. I just want to show this can be a bit on the dangerous side.

So in this video. We’ve had a look at how we can export and import from Excel. We’ve also had a look around some other things that we can do with views such as showing and hiding charts. You can also do this uploading and download loading of Microsoft Word and Excel templates in the advanced find as well. So if I go to my saved views, I can go to an Excel template, I can create an Excel template, and from here I can say, well, I want this particular table, this particular view download, and that will download the information there as well.

  1. Practice Activity Number 10 – The Solution

So how did you get on with this practice activity? At the moment we only have two views for our device table active devices and inactive devices. Actually that’s not true, we do have a few more, we have advanced find views, we have associated views, we have lookup views and we also have a quick find view but let’s create a new view so add view. So I will call this my view or my devices view click create don’t forget it will be shown whatever name you give for the view will be shown to the end user. Next, I want to add a device name to the left of ID column.

So I’ll just drag it in here and it’s a bit difficult. You need to ensure that there is a little marker shown. If you can’t see the little marker, which is you saw the equivalent just there, then drag it to the right or click on plus view column and we can add device name there. And now we can drag it to the left. So that is for me, a lot easier than trying to drag it from here. Then we need to add device type. Notice that the number of columns that we haven’t included is getting lower so then we put in saver number, take purchased device status, original price, current price, current value, depreciation and then finally user. So next we need to sort the rows by device type and then by device name. So click on the sort buy down here. So we sort by device type and then sort by device name.

So where there is a tie, we can also apply photos if you want. For instance, maybe we only want to see laptops, for instance, in one particular view. So let’s now save and publish it. So now that’s been done, if we go back to our app as is, you can’t see it. If I refresh, there it is, my devices view. So there we can see we don’t have to go back into the app designer for this.

So I can click on any of these or double click and get to the form. But what if I wanted it to be editable? For instance, maybe I don’t want it to say electronic key, I want to say electrical key. Well, I could edit it here in the form, but what if I wanted to edit it right here? Well that’s why we need to go and make it an editable grid. So to get there we need to go firstly back into the power apps portal, click on the star, go into advanced settings and then after quite a while this loads up. So we’re going to customizations customize the system. Then we go into entities, the old name for tables and we go into the device table going into the controls we add a control so you can see readonly grid is the only control that’s there and add the editable grid.

So let’s publish that and you can see we need to save it first. Let’s do that, save and then publish. So now that has been done, we can close this, refresh my model driven app and we should now have show as editable grid. So if I wanted to change that to electronic key, I could do that just here. Now, next, let’s go into the advanced find. So that’s up here, this filter. So that gets me into this window. So it’s going to default to a particular view or can click on new. So this is for a filter. So we don’t want that. So if I click on something, then it says for instance, created by equals crunch user. So let’s clear that. So now we’ve got this. I can edit the columns and I can add new columns.

So add columns. And here I can say I want the device name and who the user is and just that. So I don’t want ID device, I don’t want created on. So I just want device name and user. So click OK and go to save as. And so this is my device name and user personal view. So let’s close that. And there we can see my personal view that I can use whenever I want. Now, finally, I want to save the data records from the device table into an Excel spreadsheet, so I can export to Excel. And there it is.

And if I open it there, we can see all of my data just in Excel and I can edit it as I so wish. So in this video, we’ve had a look at creating a view for our model driven app. In the next section, we’re going to continue looking at model driven apps and looking at charts, dashboards and dataverse business rules. Please join me there.

 

 

img