PowerApps Repeating Tables like InfoPath Part 2 - View and edit the data

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and today's show we're going to continue with power apps repeating tables so in the previous video we set up the first repeating table so we could do an inner data and so in this video we're going to dive in and we're going to look at how to view the data we're gonna do that with some cascading galleries a form and a couple of old tricks I've got up my sleeves but first here's our intro hi my name is Shane young with power apps nine one one those guys and today's show we're gonna continue with power apps repeating tables right so just like you've got an info path this series of videos what you think it's gonna be three videos when it's all said and done is how to do repeating tables in the first video we set up the repeating table so that we could do the data entry so our users could go through add some data right we look at how we did that with a combination of forms and galleries that video got to be a little too long so we stopped that one and so now in this video what we're going to do is we're going to jump in here and really look at now how do we view that data and so we're going to do that by taking a couple of galleries we're gonna make them cascade we're gonna do a form at the bottom we're gonna have a Save button a delete button we're gonna account for a bunch of changes so so I'm gonna be pretty straightforward and so it'll be a little tricky because that's these videos do sound like fun it does to me so let's just get started and it gets started with over here on my desktop and over here on my desktop then what we're gonna do is we're gonna dump right from the start where we left off in the last one there's a link to that video below if you don't know where that video is all about and so we're going to insert a button no yeah we know we'll copy this one we'll say a ctrl-c ctrl-v boom we got button number two now on this particular button now we do not want any of this so we're going to read all that or 'is that copied is i wanted to get the right size right and so this one's going to be view and edit expenses like so boom alright that looks good to me and so then now we'll go over here we'll say new screen blank and we'll name this the view screen my clicker work view screen like so boom so then we'll go back up here well say all right when you click on this button we want navigate to that screen so navigate view screen cover looks good we use the new trick I'll hold down the Alt key I'll press the button there we are on a blank screen very easy very quick so what do we want to do the very first thing we need is a gallery some say galleries we do a vertical I'm gonna grab it and I'm just gonna drag it over here risking a tab this whole side boom for the data source we want to expense master right this is going to show us our SharePoint list which is all of the you know different expense or trip titles right and so type of expense total expenses all that fun stuff so that looks good we will do a title and subtitle and so trip to sensi yeah that seems reasonable we don't want the ID though we'll do the total expense all right good good and then the other thing I'll do is let's go up here let's make this look a little nicer so we're gonna say hey we wanna make you use that text function so text on that and we're gonna do this formula right so dollar sign we do a number comma number number number will do 0.00 got that one memorized okay and so if you haven't seen that function before write the text function form at the number four is pretty straightforward and this formula right there's a whole set of series of things you can use in formatting but what this says is I want a dollar sign the beginning and then I want number signs or numbers you know if I have numbers I want to put a comma in there so that's what all these three are so they're all optional the zero in this spot means that if there is no value just put a zero there so that way for some reason I had a record was at zero dollars I wanted to say zero point zero zero right the same of the cents I want the cents on all of these records that didn't have them before to be there so that's why I did the hard-coded zeros easy enough I thought so okay so now that we've got that Gallery in here we need a second gallery and says second gallery is going to show us the details so let's say gallery we're going to a vertical I'm kind of dragging it over here beside and we'll put it up here for the moment we'll say I want title and subtitle for that one also and we're going to do expense details all right so there's our pieces we could grab our formula and format the numbers again we won't do that though but so right now this is showing me all the expenses expense details well I don't want that right so we're going to do is we actually want to filter this one so we're gonna do is we're gonna say alright I want to filter you and how do I want to filter you I want to filter you or I want to filter expense details and I want to filter it by mm how about master ID yep Master ID not plus equals our previous gallery right so let's go over here make sure you name so this is called gallery 1 will rename this to master gallery and it sounds cooler okay so go back over here master ID equals master gallery dot selected dot ID boom okay so what that's going to do is whatever item is selected over here we're only going to see the details for that one right so trip to sin see that's three things tied to it flight rental car hotel and we know that right because if we look over here we'll see that trip to Scentsy is ID ten and then over here remember we wrote our master ID that's the key that ties all this together and so there's three tens flight rental car and hotel flight rental car Hotel boom we're doing exactly what we wanted I'll make this a little shorter now visually you could make this look better right maybe you want to make it look more like the form we did in the entry maybe you want to make this you know have some color coding shading that's the fun thing about using galleries I get you here and we get the data connected and you guys can format these and make them look much nicer as you want now I am gonna make a few changes though and actually grab this gallery right here we're gonna pull it down I think weird that they line up so well I don't line up so well there you go and so maybe some labels at the top but the thing that I wanted to show you so right now in order to select this item right you've got to hit this little arrow I found that obnoxious and my users have a hard time with that so one of the tricks that I came up with that I had not ever used before go to your gallery okay and their gallery has a property called on select and we're going to use this property to drive some behavior alright because one of the things that really know is you've got these stack galleries is by default they're both here and there's always an item selected so you always see the thing over here so what we're gonna do is we're going to say I on select anytime someone selects this gallery so clicks on any of my cards I'm going to update it variable we're gonna call it put the curly braces and then we're gonna say show gallery - right that's neighbor gallery and we're gonna set that to true so anytime you come in when you click on this we're going to set this variable to show gallery true okay that's easy enough so then we'll go over to a gallery - alright well click on in the whole gallery we'll say hey for visible for you I don't want you just to be true instead I want you to be show gallery - now I remember show gallery - is a boolean variable true or false visible takes true or false so no if no thinking no nothing required it's just simply whenever you click on this one it'll make the variable true and then we'll show over here so let's give that a try so hit play let's click on taco boom monitor keyboard looks good Tripta Redman boom now I notice I don't have to click this arrow right my users had a hard time clicking here now I leave the arrow here so that they're mentally thinking about clicking it but in reality I can click anywhere in this field because that was the way we went ahead and design the app to make it work so alright now the other thing that you have to consider though is that what happens when you leave and come back without variables always gonna be set to true so what you want to do is go to view screen and we're going to set on visible to be to update that variable so we're going to say all right I'll invisible so when the page update this to be false now I struggled with this right I didn't want to show you on visible I don't like to use on visible because it needs to be in the documentation that you're using on visible because it's not easily discover while the next person so I probably would have preferred that I had done it by going back to the here and doing a set here so set a global variable to say show gallery to and then did it over here right and so then used it here the problem without those that was a lot of flipping back and forth for making this so I used a contextual variable so you can pick how you do it but I wouldn't argue if you did it differently okay so hit play so we say view and edit expenses nothing going on here and so now if I click on try to write right here in the middle then what we should see is as Sue's power apps catches up 66 then one of the things I've been fighting power apps with over the last couple days it a little slow on the day to refresh I don't know I must have done something to make it mad but overall I think it's good just go back over here screen one do it again Bua net expenses will say hey taco and there we go this time it's happy and work so whatever how that was why you noticed in the example app I had a refresh button down here data refreshes for being bum bum me out no problem so cool all right there we go our app is now showing so the third thing we need is we need a form so we can edit these guys from grab an edit form what's your data source going to be is going to be expensed details so and then all we want is expense item item cost or and get rid of everything else there you go fast board do that real quick whoo I kind of bring this over here let's go like this yes we're gonna put this man somewhere about here pull the top up okay and so then what do we want here so the data source the expense details but what is the item glad you asked it is gallery two dot selected boom now we're seeing the values from here so this is how we're gonna create the Edit experience now what we're probably going to do it'll come up here and we'll say all right let's get rid of this because I don't want arrow will throw away Edit icon in here Oh nope not there click on the card make sure it's highlighted icons edit there you go when you see the W no you did a good job I don't really care where it's located and so we're not gonna do or just like we talked about before I'm gonna make the whole thing on select so I'm not gonna worry about setting just the Edit pencil so for my gallery we're going to say on select which is right over here and so with this one what I wanted to do is I'm going to make another variable I'm gonna say update context and we're going to say this time show form to write great names right I want you guys the name yours the right thing I didn't want to spend time in the video doing it I sort of uh set this to true also just like that and now you know what I'm going to do I'm going to this forums a forum you are going to be visible so right here only win show forum - boom so it's blank right now and then we also need to go back to our screen and say all right screen update that one to false and then also make sure that we update show forum - to false so then that way we're setting it cool okay so let's go back to the home let's put ourselves a back button here so keep having navigate that way but I'll call this home was this button gonna do it's going to navigate us navigate us it looks like I named that screen one good job Shane way to be responsible name your stuff justice all right so let's hit play let's go back to the home screen view and edit expenses nothing showing let's click on trip to Redmond boom there's a trip to Redmond let's click on cars there you go okay so now we're showing all the things all these users click on it which is what we wanted now what we need to do is we need to worry about saving the edits now you think you know the answer to the saving yet its name I'm gonna tell you it's a little bit harder than you think it is because we have to do two things we need to save the edits easy but we've got to update this master expense and it turns out that's a lot harder than I thought it was and it would be a lot easier to do theirs functions that would help us with that but because we're using SharePoint as a data source we have to make sure that we're using delegate able functions guess what the some function that I want to show you how to use it I used in my first example it is non-delegable so it doesn't work if your list has more than 500 items I can't show you how to build a solution that has more than or less than 500 items so we're going to solve the problem and avoid delegation because those blue little icons those are sad panda stuff so what I came up with you ready for this is we're going to add another card so we're gonna click on a form I'm gonna say so fields we're gonna say I want to add a custom card okay boom just like that will close this oh no no no no why you wanna be rude like that form three selected we want two columns thank you okay so now we've got our custom card down here we're gonna make it smaller mm-hmm that way we can make a form smaller again and so what I'm gonna do is I'm gonna put a field here or label here so we're going to say insert a label just like that and so this label is gonna have to do the math for me because I'm going to need this data later and so we're gonna change this name to be expense change but I will type it like that expense change boom okay and so what's gonna go in here is two things and those two things are we're going to pull in the current selected through say a master gallery I need the currently selected costs right so that's going to be all the way down here at the bottom total expense okay right so that's the 1400 523 got it but then we're going to subtract from that whatever is currently in item cost right so 1062 or so it was 1405 minus 343 gonna have to trust me that is 1062 got it okay but then we're going to add back to it whatever they type into this card so then name this card right now is we call this our expense card to make this easier okay so back over here back right here plus expense card okay and so right now you can see that it's 1405 23 which is what it should be but if we might play if I came in here and I said oh you know what I don't like this 23 cents on this item so that changes it to 14.5 or if like oh that really costs $500 right now it bump this up to 15 62 so the reason that this label is here right now is so that you can trust me and see that this math works but this is how we're going to calculate if they edit the item cost this is where we're going to figure out what that Delta is so that we can write that back over to our master gallery where we keep up the expense right in the first example we were using a collection so we could use some to calculate that but we can't use some because this is a SharePoint list now it's not just a question it's a SharePoint list so we've got to do this fancy math alright are you kind of with me I know it's a little weird but trust me you need this and you're gonna see where we use it in just a second and then once we're comfortable with it we can just hide it so we don't need it anymore okay so we got our form I've done all the things I need to do to it so I'm gonna click on button and I'm gonna drag a button down here oh I do not want the button on the cards we're going to eat that button go right here we're gonna say I need a button there we go well drag it down here we're gonna say saved okay now this button now we only want it to be visible if show form true or show form to is true right so boom it's visible all right and then when you click on it what do we want to do well we need two things to happen but we're gonna do what we do one when you actually click on it so on select we're going to clear all that out I move my mouse and say we want to submit form and we want to submit form to right that should make sense so whatever changes they make in here when they make those changes we want to push those back into our SharePoint lists got it once that's successful then I need you to go here to form two I'm gonna say all right form two on your success we need to do some things to celebrate how smart you are form two and so the first thing we're going to do is we're going to patch expense master and where are we going to patch we're going to patch or what I know I should say we're going to pit a patch master gallery that's selected all right so whatever record they clicked over here that's the wall I want to patch and what are we going to patch we'll all we have to do is update total expense and what do we need to set total expense to we need to set it to expense change right so like a pyramid form total expense you're going to int B expense change like that and then we will close or Curly's close this and then BAM Oh wham-o okay so the idea is that in this scenario if I made this change we will update this item to five hundred and then we'll update this to fifteen sixty - okay let's walk through that and make sure this all works make sense heck I might have a typo in here I might have to come back and fix it I'm kind of nervous that this isn't good this is gonna want to be a value you know what we're just gonna save that we're just gonna make that a value right now to avoid it being mad at me so value dot boom now I know it won't work or now I do it no one no that won't work ok so let's start over with my let's check this out so we go back to oh I'll say play take me home if you and added expenses we will click on try 2 because that one seems a little more easier numbers quick on that we'll give this a second update time on power-ups you can do it there you go thank you so this one has a record for car and for truck we're going to click on the truck record and we're going to see ice there's our stuff remember we left this 66 here so we can see it so we're going to change this to be 30 okay so truck should be 30 and then try to should get updated 63 so what's hit safe cross my fingers all right oh that changed to 63 that's a good sign that changed to 30 let's go back out and just back in just to make sure we feel good about viennetta expenses try to sure there you go so we were able to make edits on the fly to our data here and we were able to update both lists with one click of the button one more thing I want to show you and then we'll call this video we've done and the last thing I want to show you is I want to be able to delete the record so I'm gonna hold down the Alt key and click here let's go and create my variable so then that way this shows good good and we're gonna add one more button I'm gonna say button we're going to pull that button down here we're going to say button your name is delete right I want to be able to delete expense I and this zero row I wanted to eat that out so the way we're going to delete that button or that out is when you click on that we're just gonna say remove from where all expense details what do we want to remove we want to remove gallery - right that's up here yep it's highlighted boy thank you not selected okay so then that will remove the line item out of there if I was a little smarter I'd probably grab this form and pull it down a little further oh let's pull this down like so seems pretty straightforward to me but wait we didn't account for one thing though right what are we not account for we've got to update this master again always something else to do right so the remove is the correct thing to get rid of the item but we got to update master so we have to do another patch so let's do a semicolon here to kind of get rid of the grumpiness will say patch and we want to patch you want patch expense master all right so we want to patch that guy over there that makes sense and what item do we want to patch we want to patch the one that is update or is currently selected so let's say like this for us a master gallery boom and what item do we want to do what we need to change his item costs so we're gonna say alright or your total expense total expense all right so what's it gonna well this is what this took me a few minutes to figure out last time I did this and what it turned out the way to do it is we're gonna say we wanted to equal gallery master dot master gallery it would help by type right master gallery dot selected dot item costs or item cost total expense all right so we're gonna take its current the total expense and we're going to subtract from that expense detail or the gallery to dot selected dot line or item cost well close that and that all right so it's a little mad what's it matter bout hope because we want mastery gallery dot selected here there we go okay so let's talk about this for a second is to make sure it makes sense to you so we're going to patch expense master right so that's our master list that's this column or this these items we're going to patch whichever one we selected right that's how we got here we clicked here we cooked here we cooked here so whichever one we selected we're gonna update total expense to equal rinse with alcohol and means master galleries selected total expense so whatever the number was here - whatever the item cost was so if we got rid of truck then we would reduce this one by thirty dollars once we've done all of that then we're going to remove the item out so I know that's that's a lot so let's back up and let's try this again okay so we'll go back up here we'll say play will save you and edit expenses we will click on try to because that's one we're playing with and so I want to get rid of this zero record now I need to hide this delete button remind me do that a second click the zero so that's one showing we're gonna say hey you gotta go it's a delete now what I would recommend that you do is on those on that delete is I would watch my pop up video hopefully leave a link to that below and make a pop-up say are you sure you want to delete right I hate to have a delete that just goes on the first button press because accidents happen but so let's fix delete real quick also right we're not going to put the pop-up in because you don't want to watch me do that right now there's a whole video on that but we're gonna say you are whether or not it's visible show form two and then the last thing we want to do that now that we're comfortable that this is processing right right it's making the deletes and things the way we want what I want to do is I'm going to take this card I'm just going to hide it so I'm going to say alright data card one I want to have your visible property just be false all right so we're just never gonna show that one so we'll pull this back up so I need the room anymore but then that way they don't see that but that's we were doing the math to kind of validate that things were working and pretty typical I have put a lot of things on the screen that give me something to look out and see so I can think and do and then when I'm done I hide them or get rid of them just depending on what their rule what their needs are but I think that gets you everything that you needed to delete and see let's just do it one more time make sure I feel better home view and add expenses will click on try two and let's delete the trucks from quick on truck or will change him to be 50 real quick just make sure that works so 50 save so then this will switch to 83 50 30 boom I'm cooking car or nope will click on truck again we will click on right here I will say all right bye bye cars up here by himself try to 633 success we have now been able to view and edit all of our things our repeating table in a pretty cool little fashion right you guys have the ability to make this look nicer and prettier I want you to do that out but mechanically now you know all the pieces so in the last video what we're going to do right well preview of what's to come is we're going to jump over there we go back to our data entry form and we're going to add the inline editing there right so it turns out that took a lot of Hoops to have the edit and save and all those types of buttons so a bunch of contextual variables again woohoo but we'll do that in the next video to kind of finish up this series on all things that are repeating tables you have any questions about any of this you know where to get me right you can hit me up at power apps 9-1-1 you can tweet me at chains cowls leave comments below I respond to those all the time get hundreds of those a week it seems like these days which is great keep leaving comments um and then finally I would just remind you how quick the subscribe button over here I always appreciate that so thanks and have a great day hey it's me again if you get a chance remember to hit the subscribe button if you want work together click on the old power apps nine-one-one always happy to do what work for you work with you for you buy you whatever makes you happy if you need a link to the video that does the next this series it's about right here or somewhere else on the screen is the power apps all that playlist if you want to see it alright thanks and have a great day
Info
Channel: Shane Young
Views: 52,709
Rating: 4.9811764 out of 5
Keywords: PowerApps Repeating Tables, PowerApps Repeating Sections, PowerApps View Repeating tables, Shane Young PowerApps911, Shane Young PowerApps, Power Apps, powerapps tutorial for beginners, powerapps repeating tables like infopath part 2 - view and edit the data, powerapps repeating table, powerapps expense report, powerapps expense claim, powerapps cascading galleries, gallery, powerapps, powerapps infopath replacement, powerapps vs infopath, PowerApps911, PowerApps Repeating Section
Id: DylxsXIUyDc
Channel Id: undefined
Length: 28min 24sec (1704 seconds)
Published: Thu Jun 21 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.