Creating an Edit Form and Fixing Defaults in Power Apps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone my name is Andrew hes and today we're going to keep building out this power app that we were working on last week so if you're new here for every week on Monday at 9:00 a.m. I'm going to release a new video and we're going to keep building up this app from blank all right so we created this I like to call it our vision but it's really a wireframe for our power app and I want to talk about the importance of this giving ourselves a vision of what the app could look like in the future is huge we really need to focus on you know solving the problem for the reason we're creating the power app but I want also want to quote Jeff Bezos we need to be stubborn on our vision but we need to be flexible on the details all right so let's get [Music] started the first thing I'm going to do is I'm going to create a new button up here so I'm just going to copy paste the inspection button and it's going to go to screen three so it's going to go to screen three now and then it's going to do new form on form two so now if we just click on let's see we also want to change the text on it so the text is going to say new customer so now if we press play we have our form and we can type on it and it's going to add the two Fields together to create full name so the main part I wanted to work on today was on the new inspection form I want the customer names to come from that SharePoint list that it's writing to so if we go to SharePoint and we look at that customer tenant list you can see I have a few in here so I have three customer tenants that are in my SharePoint list let's change this customer tenant text box to a combo box so what do we need to do we want to delete this uh text box here so you need to come to the advanced on the right side here Advanced Tab and unlock it first then I'm just going to delete that text box and I'm going to insert my own combo box insert my own combo box here make sure it you know takes up most of the entire space and for the combo box the data source let's see if we can get it to pop up the data source we're going to do the customer tenant list okay and now for the red X's let's check out the red X's here it's looking at data card value three but we replaced it with a combo box and that's combo box one so I'm just going to come up here where it says data card value three and do combo box 1y and the same thing right here for the height let me see if I can get that right we want to copy paste so combo box Oney combo box one. height and for the other red eggs it's saying the update property this is how it saves a SharePoint is off so I'm going to delete this entirely say combo box one. selected and what do we want to update in there the full name so that was our calculated FEI field now if you notice we do have an issue here and it's probably going to say we have a delegation issue so this is a delegation warning on the search part of our combo box so I'm going to come over to the right side over here Fields do edit and right now the primary text if we press play it's bringing up you know IDs that are not showing let's change the comma box I'm going to click on it again the combo box on the far right side on the edit I'm going to change this from primary text I'm going to change it to full name and the search field will do full name too all right so now we have the full names in there now this does leave us a delegation issue but it's okay but let's let's double check and check it out so if you come into settings of your power app and a lot of people run into this when they use a SharePoint data source or even Excel I don't recommend using Excel but you'll notice right here we have a data row limit and yours will probably actually say 500 you can increase this to 2,000 that can be your data row limit of 2,000 if you use an out of the box I I wouldn't say out of the box but if you use a SharePoint data source but a data source that's not delegable so some rows may not be retrieved so in order to fix that there's things we can do so let's go and it depends on where you want to do do it too we're going to create a collection and we're going to create a very simple one so I'm going to go back to screen screen one and every time you navigate to this screen we're going to collect the customer database or SharePoint list so I'm going to go to the unvisible and this is going to help us get rid of that error so on the on visible of this screen what I'm going to do is I'm going to clear collect and I'm going to create a collection collection this is the name that I give it of customers collection customers and what am I going to collect I'm just going to collect the customer tenant SharePoint list that's all I'm doing so I'm going to collect the entire customer tenant SharePoint list and now I want to go back to screen is it two let's see screen two and we look at customer name in new inspection instead of the items being the customer tenant we're going to connect it to our collection customers and so now on this combo box let's select the combo box we're using the items of collection customers so to edit Fields let's reclick full name name again and that error went away so now we're using that collection that we're collecting and it's still pulling in the same data from SharePoint now I'm not going to say that the collection is fully delegable it's not it's not fully delegable but there's other ways around that but for this video we're not going to get into that today but for right now for my issues of seeing that error the error is gone so now we can fill out a new customer so let's fill out a new customer and the new customer will be see hermy uh grer and so we have some phone numbers in here if we want to and now we can save so now when we come back to this screen and we come and we see our drop down and we click on new inspection in the drop down you'll see we now have that new person in there now for right now we can only have 2,000 that's searchable so the search uh function there is not searchable above 2,000 so right now we could search up to 2,000 people with the delegation issues but let's just leave that for now and let's work on location names so I want to create another button and this one is going to be our location so this is going to be new location right so we're going to have new location we're going to create a new screen it'll just be a blank screen for now and we're going to insert an edit form on the locations data source all right so we have our location form just going to move it over I'm going to delete attachments because I don't want attachments so now that we have our locations form now we need to insert a button and this button is going to save for us the text is going to save and on the on select of the button we're going to submit form and this is form three but if you remember from last week that main thing that I really like to do is on the advanced properties on the form Advanced properties on sucess I like to navigate back to screen one on a fade all right so let's go ahead and fill one out we can go back to our screen one we have a new location on the on select we're going to do a new form on form three then on screen four we're going to navigate so here's a tip you can also hold down the alt button and it'll allow you to interact with your form so I'm holding down alt right now the ALT key and then I can just click on new location all right so let's say for the area let's say it's a I don't know capital building one two three here Street I'm just making up some things and the type is um a public building I'll just hit save so now on that new inspection form let's do the same thing I'm going to go to the location name I'm going to unlock it so I'm going to unlock it on Advanced right here I'm going to delete the text box I'm going to insert a dropdown or actually a combo box this combo box is going to use our location SharePoint list it's going to give us that delegation issue we're going to first fix the red X's okay so to fix the errors now we're going to change this to combo Box 2 change this to combo Box 2 now we fixed the first error the second error is we're going to change the update property to combo box 2. selected and this time we're going to do title we're going to say title because that's what we want to pull in so now if we press play you can see we have the titles in here it's bringing in the address address so let's click on the combo box go to edit fields on the right side set up address we're going to title title press play so now we see our titles in there now we want to fix that delegation issue this is just a temporary fix I'm going to go back on the main screen here on the unvisible property of screen one going to do another collection so I'm going to do a semicolon clear collect collection locations the locations we're just going to change the data source for collection location we're going to edit the fields as title title so now we don't see that delegation issue in there we press play we have our customer names and we should have our locations let's make sure we go back into new inspection and we have have our locations in there so now you can see these are now connected to each other so for the action item let's just say um fix the ceiling fan with the date we can choose a date the customer name Hermione Granger the location is the capital building and the status is needs fixed or I'm not sure what the status is we can change that to a drop down also the category is at risk we can change the date observation is fan is hanging off the wall and we can just click save so now we can see we have this now this Row in our list so you can see that my categories and my statuses did not match up right so we need have need fix we have warnings we have caution so let's go back to that inspection list again so we're going to do the same thing with the customer name and location name now it's status we're going to replace it with a drop down I'm going to unlock it to Advanced unlock it I'm going to delete the text box here I'm going to insert a dropdown this time insert a dropdown and this dropdown the items I'm going to manually write these in I'm going to do a square bracket for the status are let's say caution warning and clear how about that so now in our dropdown we have those three different uh options so now let's fix the red X's so for the first Red X it's looking at the data card value five which we deleted and it's now renamed to drop- down one so we'll just do drop down one drop down one oh drop down one here drop down one here and now for the update property it's drop down one. selected. value okay so that's all there is there so now category let's change that one also and I'm going to unlock it delete it insert dropdown the drop down is is going to have which items it's going to have public building not sure what all my my options were apartment item property okay so let's just do that apartment and I don't know um let's say item so now in the red X's we're just going to fix these again drop down two here again drop down two this red X is going to the update property is going be drop down. selected. value now if you notice I made all of my fields in SharePoint single line text but in power apps I converted them to dropdowns and combo boxes the reason is when I want to come back and edit this power app I don't want to do the edits on the SharePoint side I don't want to come to my data source and change a field to a category right that's going to cause me all kinds of headache I'm just going to keep it a single line text in my data source but on my front end on my power app now I can say oh I want a new drop down well I can add another one here so maybe there's a new category I'm going to come to power apps and I'm going to add a new category for house and that's how I want to update my power app in in the future is I want to do all the work on the power app side not on the SharePoint data source side that's just my opinion that's my preference that's how I do it all right so we have a full working power app now with three different screens I'm going to move these buttons the left side so this is where our left side navigation is going to be we have our nice form I'm going to you know change this a little bit to so the fields here so I'm going to go right here behind this one I'm going to move this field right here to the left a little bit that way I can click on this entire row I'm going to go to template fill template fill and I'm going to say if this item that is selected then I'm going to do a different two different colors I'm just going to copy that rgba and paste it twice so if it is selected I'm going to give it a one one on the final number the final number is the alpha value I'm going to say 255 for the green I'm going to say 225 for the blue I'm going to say 225 that kind of gives me that red color maybe we wanted a little more red so I'll lower these second two numbers 20111 there we go so now it's highlighting the line item that I select so that's there now I want to make this Gallery look even better so I'm going to go to the status field so I have three statuses so right now I have three statuses although one is in here as need fixed we're going to change that in a little but what I want to do is I want to make like a stop light I want to make a stop light so I'm going to insert a circle I'm going to insert a circle in my status field here and maybe I'm going to make it a little smaller I don't like it taking up the entire space so I'm going to say the width is 40 the height is 40 well let's go 35 let's go 30 30 30 30 five width oh there we go I like it just like that so now on this circle I'm going to change the fill property I'm going to go to fill and right now it looks like it's a blue color but what I'm going to do is there's three different options I'm going to say and then you could do this in an if statement if you wanted to so we could go over an if statement or we could do this in a switch statement so when I Google an if statement you can see here we have if and switch functions pretty much they're very close to the same you see you can have if condition then result then condition two then result two and and Etc I find that more difficult if you want to do an if statement do true or false if there's more than two options do a switch statement so a switch statement is matching Result One to match one result two to result two result match three to result three so it goes uh further and further down so you can see the if statements but the switch statement is what I want to do so let's build out a switch statement so on this circle on the fill property I'm going to say switch and what are we switching on if this uh let's say status this item. status if this item that status is equal to caution then we want it to be color. yellow and let's just end the parentheses there all right so now if it's caution it's yellow but then we do another comma if it's warning then it's color. red you see that now if it's what was the status let's check it out the last status was new inspection clear if it's clear then it's color. green all right and then I'm going to delete the text field right here that text field so now we're just left with that stop light that we have have here for our status now on top of that we notice that I have a status that didn't really match so we want to be able to edit so in order to edit a line item need to do something different right now we can only create new inspections we can only create a new inspection but let's say we want to edit one so I'm going to move over give myself a little bit more space let's I'm going to move over the ID and we're going to put a insert a pencil tool and it's called edit so edit icon right here so this edit icon what is it going to do on the on select of the edit icon it's going to select the parent you want to keep that in there that means it's selecting the row we're on so that's selecting this one it's selecting this one selecting this one that's what that means it's selecting the row that we're on so now on the pencil tool after that we're going to to edit form of our form one and then it's going to navigate us to our screen two on a fade now you would think that would be all you need to do but that's not it there's one more thing we need to do so now when I click on it let's say fan hanging off the wall and I click edit you notice that it's blank what we need to do is come to this form here and on the items property item we need to say hey the item is whatever we select in our Gallery so Gallery one that's selected that's it so our Gallery one if you take a look at it is right here this is our Gallery one so whatever we have selected in our Gallery is the one that we edit so we go fan hanging off the wall we change the status to clear we hit save it then updates that line item so now we can edit our line items isn't that beautiful so now we have three forms we have added a stoplight we have categories we have locations let's say we wanted a location in here library and and T we'll save so we have that in there now there's one more thing that I wanted to do and if you notice that when you come in here to edit it's not displaying the default property and that's because we changed it to a dropdown so on the or a combo box so on this combo box the default selected item all right so in the default selected items property we have to be very careful we're going to do the squiggly bracket and what is it that we're pulling in for the let's see the customer name it's the full name and this is in the gallery one do selected Dot customer name so we're mapping it to the name of it in so let's check that out in the inspection power app right here in the customer tenant it's called full name you can see it's called full name in the inspections table it's called customer name so from the customer table it's full name from the inspection table it's customer name and you're kind of just matching those two together so for locations this one is the title right so in our locations so in our locations list it's called title in our inspection list it's called location name so here we're going to say title wigly bracket title is equal to the gallery 1. selected dot location name uh let's see if I can spell location right there we go so let's fix the default on the status also so the default property and no this is not default defa selected items this is default it has it as one so that's saying the first one on the dropdown but that's incorrect it's going to be Gallery one. selected dot uh what are we under we're under status okay same thing in category default it's Gallery one do selected dot category all right so now let's double check our work when flooring was damaged let's check this out flooring was damaged was the observation the customer name will change it to Hermione Granger in the capital building we'll come back into it it's still Hermione Granger on the capital building the status correct is the house is correct the flooring was damp we'll come into this one it's Andrew H at the home office I'll just click save again I'm just kind of double-checking going back in everything looks clear everything's matching up correctly so that's what you need to in order to pull in the default properties it can get a little confusing at first but just take your time no I went very fast there are ways that it can break so watch this if I change customer name and maybe you look this up maybe I change this to Value so on the second one I'm going to click save and I come back in notice it's blank now but when we change this back to full name change it back to full name and we go to Andrew H and we click save come back in then it's correctly working so there's little bits of errors that you maybe you find online that may not work correctly try and find out the right one that works for you now another thing if you're doing modern it's different so this is just for classic power apps right now and this is just for the outof the-box form all right so my name is Andrew hes hopefully this was helpful I am working on like my recording studio so I'm trying to get my sound right right my video right things are changing uh feel free to let me know if you you think something is off uh I'm working on it but next week we're going to work on filters we're going to try and filter our Gallery filter our dropdowns maybe add a search to our gallery and kind of go from there so that's the plan from next week so my name is Andrew hes I'll see you next time thank you
Info
Channel: Andrew Hess - MySPQuestions
Views: 2,774
Rating: undefined out of 5
Keywords: power apps, power apps tutorial, how to power apps, creating an edit form in power apps, creating a custom form, low code no code, power app dev, developing in power apps, beginner power apps, power apps form, power apps edit form, new form in power apps, defaults power apps, defaultselecteditems, defaultselecteditems in power apps, sharepoint power apps, datasource power apps, powerapps, sharepoint, Power Apps formulas, power apps form fields
Id: EilrB5RqJDc
Channel Id: undefined
Length: 25min 51sec (1551 seconds)
Published: Mon Apr 22 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.