SharePoint Power Hour: PowerApps & Content Types

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] all right welcome hi I'm Laura Rogers this is SharePoint power our this is our weekly show we have Joelle Jobson here she's on audio say hello and we have my daughter Kristen who's 10 and she's also in slack chatting with you all and she's my assistant today um very helpful she helped me set up the lighting and did some you know technical stuff for me so and she also picked out the background so I told her she could help me and she could pick out the background today so we had this lovely sort of rainbow thing weirdness going and that is thanks to Kristen very psychedelic right so Power Hour is where we go we're not developers we go over non technical stuff in SharePoint and office 365 and we talked about just we've been doing this for you know over three years or so five years we talk about all kinds of different topics we also are in slacked chatting so that's the platform we use for discussions as we go that's the fun of having it is a live show is that we can chat about things and you all can ask questions and stuff like that it's very informal so the in the description of the video that you're watching has the link to to the Select Channel and it also has a form that you can fill out if it's your first time if you haven't joined this like channel yet because I have to manually invite everybody so come say hello in the slag chat and the little power our channel in there and we'll go ahead and start our topic so this week's topic is share points and power apps and content types so content types are something that's been around since SharePoint 2007 we use them to have different types of content in SharePoint one of the ways that we use content types is when you have say a list and you want to have basically different fields showing or hiding or being required according to different criteria like a certain status and so that's so I put a link in the chat to this blog post I wrote back in 2009 on how to use content types as statuses to where I'm the example was patience or because I worked and in health care that's where I got my start in SharePoint and when I wrote that blog post um the patients are going to the hospital they have different statuses as they go through their treatment at first they're in new new patient and then they have certain fields that need to be filled out when they're new then when their current patient then they actually have a room number and they have a doctor to have things that a new patient isn't going to have and then when it's time for them to get discharged then there's a required discharge date and it discharged to information so and of course when there are new patient there you're not going to know when they need to be discharged and so as they go through their different sort of stages then different fields are showing or or hidden or required based on that so that was the example I gave but we've used this a lot of cases just through the years right Joelle so um can you all and I put kind of in the chat for you all to kind of think of some things examples that you do for content types so that as I start doing this demo you all everyone will kind of be thinking about it and have some context and so Joel you think about your favorite or one of the prominent things that you've done with you know having various content types and a list and I'm going to read a couple of the ones that people have said in here let's see so Becky says multiple content types in a list when there are different groups that complete specific fields and so what she means is and she kind of went on to be more specific is like some sort of request form some sort of form gets filled out that goes through sort of different stages or may be approval stages and at the different stages it needs to have different fields filled out so that's it so that's what you could use a content type for now in the example that I gave in that blog post the way the content type is changing is just via workflow just it's just changing behind the scenes so but change you can you know give people a drop-down box to change the content type but so the changing of the content type isn't really the complicated part is it isn't the part that's the center of that blog post or this video but it's the fact that of making power apps do different things based on different content types so Joelle did you think of a good example yeah let's see who else said Nicholas says I use content type specific content such as employee performance reviews or management and versus non management employees so management versus non management employees in a list like that would have different fields that you would want to fill out depending on which type they are that's a good example and then of course document management is a whole yeah people use content types for document management too we're not going to focus on documents Oh Jay Sarah said he can hardly hear Joe well I we didn't test the audio did we we always test the audio and then I know thanks I'll just put a default microphone and default speakers I don't know let's see if that works all right Joe well talk again and we'll see if I don't really want to do a bunch of troubleshooting I should have done that at the beginning anyway it's always something right Oh Kevin says he uses a non-proposal trackers as proposal moves through the different stages okay so those are some good examples of content types now I'm gonna go ahead and share my screen and we'll we'll build out just really quick the example with the patients we're not gonna build you know a whole bunch of fields but I want to be able to give you all this concept and then show how you can do it with power apps now I did build one just to prove it out just to make sure it works beforehand so I'll show you the this example here on my screen alright so in this case we have a help desk request list so you have just a help desk request that can get filled out with information about you know I don't know the department priority what's wrong stuff like that just typical and then so I have a couple of different content types one of them is just that it's assigned to somebody and one its helpdesk escalated and so I just did a really quick little example of if when someone is editing a help desk item that's been escalated I wanted it to be this red form so I didn't do anything drastic with like showing and hiding in fields in a bunch of stuff all I did was change it to be red so I'll show you that so when it's assigned could open it it's white I go edit it still white but then when I go to this one that's escalated when I'm looking at it it's white but when I edit it it's red so that is based on the content type being health help desk escalated so that's just the gist what I accomplished there is the just the basic gist of it of doing something different based on the content type so we'll go ahead and build something real quick since you know we have plenty of time I'm going to go to site settings and go to my content types and I'm surprised I don't have this example built already you know my content types that I have that exists in here it's okay alright so I'm going to do patient and then put it just in this little custom group here and I don't need a parent content-type my parent content type is gonna be let's see the list it's just going to be a regular old list item so it's just a generic list item as my parent and then I'll just put it in the custom content types and then we'll give it a couple of different fields like patient just put their room number and their doctor and just gonna put a few more just so I can have different things for different content types and then discharge date it's a date field and then I can have admission date that's when they arrive at the hospital by the date and I can even default that to today so when they're filling out a new one it's today and then discharge to and then what else I can do like their condition or something like condition what's wrong with them okay so then from this patient content type I'm going to have some various the three different stages alright so then I'm going to go back to content types anime views this patient content type as the parent and that's where I'm gonna creep this create the stages from so then I'll go dead stone patient is in here okay so I'll say patient new admission and I'm it's gonna use that as the patient I mean as the parent and then for a new admission I'm gonna leave all the fields in these when I first create it I'm just gonna leave them all there some really say new admission and I'm gonna do another I'm just gonna do two more patient current and then the parent is a lost Kristin already she's gone and then so hopefully building all these out and not just having them are already created will actually help you guys see this whole process and also you might want to decide that you don't need to do content types when you see how it interacts with power apps because you there are different you know if you've already got content types in place which i think is why i get this as a question a lot because they're people already have them in place and want to be able to use them if you don't have content types in place already you might not want to do this method because power apps has just so many capabilities when it comes to what you can do with logic all right so now I've got my content types created I'm going to go ahead and create a list just call it patience and go straight into the settings go to turn off the allow management of content types and I always like to get rid of attachments just just a pet peeve they come in and need them and all right so then I can go add those eggs I'm going to add all four of them go to my custom content types and now I've got all those added I'm gonna get rid of item I don't need that and I do in our class and we're like the classes that we teach the power user class I have a whole module it's like an hour hour and a half on content types and it explains all this and teaches who this instead of me just clicking around just fast you know clicking through everything okay so now I've got my content types and I go back up to it see it automatically put all those fields in the list and it automatically shows me which content types each of those fields is being used in so now I can go to site settings content types and go to my custom ones and so if they're a new admission there are some things they're not gonna need so I don't need when they're discharged and it's up to you whether you want to hide it or remove it from the content type I'm not really going to go into all the differences as to why you do one or the other right now I'm just gonna hide it so now I can see discharge date discharge to is hidden when they're new I want admission date to be required when they're a new patient and dumb yeah I think that's good alright then I'll go back to the next one which is going to be the current current patient and then I can say well I don't know yet where they're being discharged to when their current patient either so I'm going to hide that and then I know know this yet make that hidden and I'll just say when their current patient their room is gonna be a required field and one more and then when they're discharged and all these things that I'm hiding all these fields that I'm hiding it's only hiding it from the form it's not hiding it from the column so you're not losing any data when you are required and hidden and removing them and stuff like that just from the content-type you can still see these in your views and your columns it's not you're not losing anything discharge you acquired so yeah so that's good all right so now I've got all these content types with various stages of being required or hidden or not so before we start editing it with power apps we'll just look at what the default functionality is so I've got I'm gonna go ahead and put content type as a column here so I can see that in my view and I'll go ahead and do a new you can see on the new drop-down box I've got paint I've got all four of them listed here now I don't really the patient one up here is really just the parent so I don't really need it to be listed I just wanted it to add it to the list so basically I like to have a parent like that that has all the fields just so that as like a baseline just so that you don't because I've found like in inconsistencies with when you add all the other ones in some have fields and some have don't and then the fields don't end up in the list at all so that's the whole point of the parent one so I'm just gonna make it invisible I don't need it I don't need people to click new I just it it's just gonna be there in the list okay so I'm gonna do a new new admission is gonna actually need to be the first one let me go back to the settings change the order so they're going to be a new admission first and then they're going to be a current patient than a discharge okay new admission okay so it says content-type and that's kind of annoying you don't usually you don't want users have to see that but I'll show you how we can get rid of that if you want and then so this is gonna be Bob Smith or how about Kristin you want to go to hospital and then I'm just gonna admission date it put today condition broken leg whatever okay okay so then you can see that's their content type yeah thanks Nikolas okay so you can see that's the content type and then the way content types work is now when I go edit it as soon as I change it to there being a current patient so now you see that the room all the sudden became a required field dr. George and so that's that was the main different thing and then I can click Save and then I can go edit it again and then when I change it to be a discharge notice as I changed it these fields changed on the fly so I can say let me discharge next week to another hospital and so that's the gist of basically the fields showing and hiding and being required based on the content type so now we're going to show what power apps can do with the content types so I'll go ahead and I want to have at least one of each of these types of content types in the list though let me go so let me go ahead and add just two more Jane Doe and she's and I don't know and current patients we will do that some lego movie reference let's see although it's not oh ok ok so you probably wouldn't want people clicking the new drop-down and creating it new as one of these other types so but I'm gonna leave this here because I want to show you again some of the powerup stuff so I'll go ahead and do customized forms Kristin's like finally power apps so excited that's not what you said yeah about did anyone else get the leg have kids and get the lego movie reference it's building my app now she's watching it on her phone that's funny okay so the first thing I'm gonna do is make this thing bigger so I'll go file app settings they're a bunch of new app settings by the way and here you all should check these outs pretty awesome okay screen size and orientation I'll change this to landscape which will make it bigger across the screen which is awesome because wouldn't this gigantic resolution that I have going though okay so now I've got my layout here I'll do two columns and title room doctor just charged a machine I don't know I don't need modified created create I do want content type though and it does have an exclamation mark that's fine and let me zoom in on that and they make this whole form wider and I did before oh yeah I made it read-only when I fixed it in that other form unlock it and then I made it so yeah I think I just have to publish it that I know I fix it in that other form you saw had an error and um I'll just go see what I did actually I think I know I made it read-only so that's gonna be the mode for you there now I'll just be able to see the content type okay and then I'll save so it's just one form right now but I just want to show you some stuff publish back to SharePoint okay I'll go open one up I'll have to go see what I did to fix the content-type in that other forum because I know I fixed it but anyway it doesn't really matter if it shows or not we know what content type it is so that's just what it looks like there's I mean you've just opened them all up and you can see that they all are just that normal form he's right there and then but notice when I do new the new drop-down and even if I pick patient like discharge just and I put them as a see it doesn't show the red like required fields or anything like for the discharge and watch this when I do save it just did new admission so that's an important thing to notice about power apps and content types is that power apps ignores whatever you pick from this drop-down box is that shocking are you are you guys surprised what do you think so yeah so basically for now at least until I don't know if that's something that's on the radar to fix don't bother with that so I'm gonna actually turn that off go to list settings and take those off of there and that's what I would do in the real world anyway is I don't want them to have a choice between all those in this situation at least I want them to always start with the first one and then so there's your new admission now the so that a little bit more let me go flip back I want to focus on me for a minute okay so this concept that we're gonna talk about with the content types the whole point of it and the whole point of that blog posted a riddle as years ago comes 10 years ago was that was just an easy free way to do some logic on your form without having to have a third party product without having to have InfoPath with just a way to have sort of some customization in your forms and show and hide things according to like something very simple so with power apps though if you're creating new solutions you might not need to do that depending on what the purpose is and what your requirements are now so like Joelle's example of having things roll up to some central location and you know based on what content type they are that's a good example to actually use content types but it depends so if the only reason you're using content types is just to have some fields that hide and show according to a status just something moving along through some approvals like manager than BP then you probably don't need to use this if you're building something new you probably don't need to use this content type method because powerups gives you so much do you need something gives you so much capability for doing logic and hiding and showing and changing and you know sort of navigating people around in the app according to just building logic so I'm gonna show you what you can do with content types but again this might not be what you need to do this might be really something you only need to do if you already have content types and you need to and you want to customize it with power apps but you want to use what you got does that make sense so this isn't the end-all be-all for you used to do it this way now do it this way this is depending on the reason you're using content types ok so here's what I discovered here's what I did we'll go customize it with power-ups and there are like several different options that you can do so one option that you have is to have a completely separate screen and form for each content type that's if you have several different fields and like it needs to look pretty drastically different from each other on each one another way that you can do it is to just have one form and to just if it's just one or two fields you can do logic with using the visible please turn right side up is logic according to the visible property and just quickly hide and show those one or two things in this same form so you don't have to have a bunch of different screens and forms to have to manage so in this example I'm gonna do a bunch of different screens but do it varies as to what as the way you do it um let me see why is that being weird single trying to look at why this has an error real quick I like the way they updated some of this too by the way the way this works yeah it's given me an error but yeah it doesn't really matter data source yeah patience just unlock it okay we can see we can see in the list what the content type is actually I can do a label that will show what the content type is let me just do that oops do leave that and sear it a label actually I need to put the label in the form not just kind of floating around here put it up here there so this is going to be this item dot name so that's the key is that your content type is kind of like one of those weird fields like people and lookups where it actually has several different values inside of the field constant type has an ID and a name so I had to do this item dot content type dot name just to be able to see the name of my content type when we zoom in a little bit so there it is so we can kind of use that as a reference so we can see what we're doing all right so there's my content type and I will go back to the other one and see what I did to fix it so you can actually use the drop-down box but I'm not going to do that yet now I'll go ahead and do the four different screens so keep in mind that okay if you want your logic when something is new to be different than the logic for everything else like when you're editing it like if you know you're filling it someone's filling out a new help desk request and you want it to only have you know not have who this request is assigned to or an extra comment field or some things like that that the IT people do on the new form and you want it once they're editing it later you want it to have all that stuff you don't need to do any of this stuff because you can do logic and power apps based on just if it's a new form versus a edit form so that's why I'm doing several different content types here because I want to show that this isn't just like a new form versus everything else this is actually several different things that we're gonna have going on because the new form is just you know there's a form mode equals new that you can use that's just really simple okay so I'm going to rename this to ser admission new admission and this is going to be the form for new admission okay and then I'm going to take this whole screen and duplicate it and then I've got another screen and I'm going to call it screen current and then warm current and one more time because I've got those you know three content types so hopefully you guys are getting ideas for how you can do stuff like this for your whatever application you're using content types for let me know give me some feedback okay sorry thanks yeah yeah I started renaming stuff I'll just show you all what I did Thanks so I just renamed this just screen new admission screen I just did like this to rename them screen current and screen discharge I just basically duplicated each one to make the copies so that's what you missed sorry about that so then I just renamed the form itself so this is the form control and I called it form new admission form current and form discharge so okay y'all caught up now and again let me know if you guys are thinking of stuff for you know ways that you would do stuff like this that's the fun of having a conversation while we're doing it okay so those are now I've got for the three content types three screens and three different forms so this is where I can do different things on the forms because remember the power app didn't even recognize like the different required fields and stuff like that anyway it just ignored the fact that you know when I created a new I click the new drop-down and chose discharge it was supposed to have required fields it just put everything as just whatever that default content-type was so on this form I can put that functionality in here so there is a required see there's a required little property in here so I have to unlock this so when there a discharge some on the discharge form let me actually gonna put some labels on these two so I can see what I'm doing as I go I just put like a little rectangle rectangles away at the bottom actually I'm gonna make that be it a label or just type right new admission make it font color whites and bigger there you know just copy and paste that to the next screen this is just a quick way I've just been able to make sure I know where I am when I'm doing this stuff current patient you can make it dynamic well anyway just type in it in here real quick just for testing purposes mostly and then I can go here take this whole thing and move it down I know Kristen's gonna want to build some power apps when we're done here she's gonna be like that is so cool can I try it okay so now I've got at least when I'm as I'm showing you this demo I can tell where I am so this discharge when it was a the patient as a discharge I need it to be required true so that's on the card so I selected the card and I put required true and then I put it put automatically put an asterisk there and then discharge date I'll do the same thing required true so did you all know that required is a property in here on the cards so if you customize something and share in empower app to customize a list and then later on you go change a field to required in the list you also need to go do this manually in the power app so the power app will know so the formal no it got changed to be required and then like admission date isn't something we need to see when they're discharged and so you could just I just basically deleted that card so now I'll go back up to the new admission a new admission doesn't need it's not gonna have discharge just deleted those and then they emission date needs to be required so unlock that change required to true and then um that's already required okay and then when they are current patient I'll make the room required and also I'll get rid of that I'm just kind of doing a couple of things so room is going to be required okay now and then you can do something like on different forms so like admission date I can move it up here maybe and on this form when they're a current patient I don't want them editing the admission date so I can take this one and go to my mode and have it be display mode dot view so that's how you can go in to these different forms and just change something to be read-only is display mode change it to display mode dot view all right and so that's how you can do different things on different forms now again you could have just one form and do logic so I could just do logic in the display mode property here and say if it's a new form then the display display mode edit otherwise display mode dot view so it could do just some sort of quick condition there instead of having a bunch of separate screens but anyway all right so so now I've got all these separate screens now I've got to make it so that power apps takes me to the right screen because right now it's just going to these properties over here are really important so I clicked on SharePoint integration here and I'm looking at these SharePoint integration properties and I wrote a whole blog post about this stuff too so on new it doesn't even have anything about navigating anywhere on new it's just doing a new form for this new admission on edit edit form new admission so basically it's only looking at that one form the new admission form on all these so then this is where when you do need to do the logic based on what the content type is to go to the right place so on new now when it's new we do want it to be the new form but I've noticed that when I'm in the list and I do you know I'm editing a form or something and then I close it the next time I do new it stays on the same screen that I was on editing the previous item so like it may take me to the screen currents instead of this new screen when I'm doing a new item so basically I need to go ad for it to be sure and navigate when it's a new form not only do the new form command but actually navigate to the right screen so I'll do navigate to let's see our new admission and call so tiny tweak over here on new screen transition on okay so new form and that's where I need it to go I need it to do a new new form for new admission and I need it to go to the new admission screen that's two different things you have to tell power-ups so on edit this is where I'm going to do like a lot of that logic so if I might do a switch there's actually a switch command you can do since I have three different things it's sort of like an if statement okay all right so here's this is the meat of this presentation basically is how to do this logic so basically if the content type is this do this if this do this etc now I can't look at this is the first thing I tried was looking at the content type just field just data from the form from the form control like from a label like this and it didn't work because when you when it's doing the on edit command it doesn't see this form yet so it's a timing thing so it doesn't know yet what the value is in this box because it hasn't opened the form yet so on edit I actually have to use this SharePoint integration function to see what item is currently selected in the list and I have to base my logic off of that so I'm gonna say SharePoint integration dot selected see I could do selected or selected list item ID dot content type dot now I don't need a dot um equals I think I need a dot name there yeah name that's what I was getting wrong when I first tried this equals um over the content types called oh oh my gosh new oh yeah thanks if the content-type is patient new admission then okay so that's the first if then I want to do edit form form new admission and navigate I can do that at the same exact time using this ampersand navigate to screen new admission so if it's a new admission I have to do so I got to do my transition transition on come on there we go okay so basically I have to use this same format for all three of them so otherwise if SharePoint integration dot selected I should just copy all that huh and just edit it I'll probably screw it up if I do that though oops content type dot name equals was it patient current or something I think that's what it was then edit form and now you're doing a different form I'm doing the forum current okay and I'm navigating to screen current yeah that was a little faster and then um I'm just gonna copy and paste equals patient discharge that's the third one then edit form form discharge and navigate to screen discharge their who clear as mud what do y'all think um we'll see Renee I think that I do need to do then that the name equals patient new admission will see though all right we'll check will test just just for editing so we haven't even done the on view yet okay so we'll just go ahead and say that and I know I'm doing save and publish is to separate I know you can just click back to SharePoint and it will save and publish it but I've found that sometimes it takes a couple of tries and its sticks better if you do save and then publish for some reason so finally I keep having to refresh it and refresh it if I do the other way okay so here's a new admission I'm viewing it I didn't do anything different for the view logic abrupt all the thing come on refresh it again there it goes okay so this is oke see that's the old one it was before I put the blue things across the top see it still didn't refresh yet so that's what Chris and I were talking about the other day how you kind of have to like do something different in your app that it makes it extremely obvious that that's the latest change like put a number on it or a different color because a lot of times the power app what you're opening is not the refreshed like latest version and you have no way of knowing sometimes if like you put new logic in there it's not working and you realize that it hasn't refreshed to the new logic let me just do a new item real quick ya see it still has all those fields and it didn't have the blue things that I put on it hard refresh Oh see there it is sometimes you just have to add a new item for some reason for it to work okay so this one's a discharge I'm viewing it I go click Edit and it did take me to the discharge screen and then I go to Jane Doe she's a new admission it's still on the discharge so this is what I was talking about now I'm viewing this one I'm not on edit mode so remember I didn't go into the view property yet and make it so that it navigates to the right screen and this is what I was talking about with whatever previous screen you were on on the last form you opened it will just open to that screen on the next one that's why you have to put the navigate on every single thing so that you make sure that it because it's not going to automatically start from scratch every time but I did do it on the edit so notice when I clicked edit all now it switched me to the right screen does that make sense all right okay so that one is the new admission and then this one is current so I can see see it's still on the new admission screen but when I edit now it's navigating oh it's navigating to the wrong screen so I'll have to troubleshoot that that that is a current patient so you kind of get the gist now what I'm doing I had to do it had to use that SharePoint integration and to look at the current item and look at what content type it is current patient discharge okay maybe I mistyped something see that sounds like a lot of work Nikolas clear your local obsession stores you shouldn't have to do that every single time you make a change right that's frustrating okay so basically I need to go put all that same logic on my my view as well I need to make it so that it navigates to the right place so on edit let me double check this yeah the second one mmm I don't know the second one's not working no I might have to re ready to test that again that's odd yeah maybe try it if see if it makes a difference I'm just gonna put all this same exact logic on my own view I don't want it always just going to view that first one I want it I want it to do now I'm not instead of edit for I'm gonna do view for them so that's gonna be the only difference all the rest is the same it's still just navigating to each of those screens okay now let's see so I've got notice the required fields are all correct etc so let's go ahead and what else do I need to fix in here no I've got that one on save it's gonna okay that's important so on save I don't want it just submitting the form new admission I want it submitting whatever the form for whatever screen I'm on so that could get a little tricky right because form new admission is just this form on this first screen so I'll have to do based on what the content type is submit a different form so then that's that all that exact same logic so that's instead of edit form it's submit form now that's gonna be interesting if it's brand-new because there is no sharepoint integration selected right if it's a new form so that's gonna be if you see and I gotta put the name of the forum this is that on if its new logic that I was talking about form new admission dot mode equals new then submit form form new admission navigate to screen new admission say that that logic needs to be different than these other ones so I think that'll work now what I'm gonna do is just real quick make some sort of obvious change in here like I was talking about to be able to tell if my change is stuck so I'm not troubleshooting for no reason so I'm going to insert I've got nine minutes left insert just a little icon on here just so I can tell visually if my changes went Chris is does it a much more methodical way he puts a number and he increments the number each time makes sense it's just kind of one of those things that you have to do just as you're working on these and troubleshooting and changing things a whole bunch okay I'm gonna go open up Bob and see if so he's a discharge I'm no see it didn't go to the new one let me go add a new item and it didn't default the admission date today so in SharePoint remember I made it so that it had current date I actually have to do this manually in power apps because power apps is not going to do that default date that I had set up in the SharePoint settings for some reason so I'll just pick that date and I'll show you all how to do that too and save that new admission and then refresh it again and see if my changes know [Music] see it doesn't have it doesn't have that little trashcan that I put on there sometimes I just have to navigate away navigate back okay come on now there it is it came back okay so there's my new admission I'm viewing it it went to the new admission screen I'm editing it it's still on the new admission screen that's good I'll go open up a current when I hit edit it goes to current but when I open it to view it it's the current one that's not working patient current that's weird discharge discharge isn't doing it either when I'm viewing it when I hit edit it takes me to the right one let me go show you all that date thing real quick let's go in there I got it let me test this a little bit more they'll want to see exactly what it's doing wrong okay so when I open up a new admission I got it we got to get our testing kind of thoroughly so we can see exactly what's working and not working so it goes to new admission I'm opening a new admission and viewing it and it's just it's on it's showing me the data but it's on the discharge screen and when I hit edit it's correctly taking me to the new admission okay when I am on a current it's not I'm viewing it it's not switching to the right screen but when I'm editing it it is taking me to the correct to the current patient and go back to new is it doing the same thing yeah it's like the view it's like the on view doesn't work hmm but the other one works so remember a minute ago I thought it was current patient that wasn't working at all like the logic wasn't working but the it is it is functioning when I edit it it's just not when I view it hmm I wonder if the view thing just doesn't work maybe I need a new need to do like a I'll have to verify that usually I use on edit but I don't know on view might it just might be a buggy thing where you get paid your big big bucks as a consultant to be able to figure out your way through just little weird stuff like that right okay story of my life yes Nicholas I did that mm-hmm see ah here on view I did all that view form navigate you yeah I did all that um and then just let's go look at oh yeah that date so let me go to the so for the screen new admission the admission date I want that to default to today so I'm gonna go put a default of now I don't want to mess with this new this item and mission date so this is how it works only if it's new I want it to default today to today right so if span that out and this is form new admission dot mode equals new then now otherwise show me the date that's already in there so that will default it to today if it's a new item and that's the same concept you do for any kind of logic of anything you want to show and hide or default on only based on it being a new item okay so now that whole thing where it was being weird when I was viewing things let's go check that out so basically it was just staying on whatever the previous screen was and just completely ignoring what I put in the on view so I'm gonna test that and change completely change what I had in the on view to just kind of test a theory of whether it works or not so I'm just gonna take the the if stuff out of here and I'm just gonna say to go to current no matter what there so this is just my troubleshooting okay so on view it's gonna go to current and I'm going to take this icon away now to see to make sure I can see that my change is stuck oh we got two minutes left oh man what do you guys think is this helpful is this going to help you take your stuff that uses content types and transition it to use power-ups or is it just making me more frustrated all the logic you have to build now to make it do what it was already doing out of the box do you think okay so now I'm gonna refresh this and I'm going to see if my change is stuck which no the trash can still there so frustrating just keep refreshing my screen mmm save wow it's not even saving so must have broke the save functionality so save logic didn't work either so the on view and the on edit works and that's what I attested this before I started doing this demo the on edit works just the the on view is just ignoring everything and the the save I just have to do different logic so that's fine okay the trashcan went away that's good okay so now when I view it it everything I view should be on the current patient so even if I'll go test one it's a new admission I'm gonna edit her so now it's on new admission so now I'll go view one so it went to current patients so the logic that I changed in the on view worked it's just that if conditions were not we're flaking out but there's actually a non visible that you can do that to maybe get around with maybe some sort of timing issue that it was having or getting confused I'm just gonna keep going yeah keeping it real world guess Laurie that's what we're doing yeah Kevin I try to Kevin sent a bit confusing to say the least I tried to keep it simple by just having a completely different form for each content type so that all we're having to do is navigate to different forms but yeah it it is it can be pretty confusing so let me go get that logic just grab this whole thing copy because the on edit is working right so remember on view I had it every everything going to the screen current so let me go to excrete current and do a non-visible and see if I can make it navigate somewhere else so if it's a current patient and don't need to go anywhere navigate yeah it doesn't like the navigate right here yeah it's not that's what that's why I didn't do it here in the on visible because it doesn't like the navigate it's basically saying you can't use it here yeah that's what I so that's what I had tried yesterday when I was you know trying various ways to do this and you know it's not gonna work in the unvisible for for these forms um I could try putting it in the on start let's see it might have the same effect though no it's actually gonna let me do that to take out the current one cool okay so the content type is new admission it's gonna go to the new screen new admission if it's discharged it's gonna go to discharge okay that's on start so let me put some sort of icon on here to make sure that it's obvious that I um that might changes or in effect and I do need to fix that the arm the on submit thing though but that's going to take a little more work I might have to have to figure out some different logic for that the on save because you want it to be able to no matter where you are no matter what screen you're on that's the thing that you want it to save so that's where it gets a little tricky so go back to share points and so on start is a is a property that exists only on the very first screen and that's something that runs when the app first loads when you first open it up so let's see if my go to my little new admission screen here and see if my little X is there no it's not keep refreshing it there it is okay so it came back now so the test is going to be on view so here's a discharge I'm going to view it it went to current patient and when I edit it it correctly goes to discharge yeah that that on view thing that could be a real pain that could be a one big reason to not have a bunch of different forms I've never seen it act like that though usually I just do different varying things on edit and usually with just kind of my personal best practices with customized SharePoint list forms I don't do a bunch of different screens I usually try to build it in one screen and just like show and hide different things according to different logic and not have to jump in back back and forth around screens in that weird that it's kind of the same thing that we had to do with InfoPath whenever I was doing a customized list form with InfoPath I always tried to not have it switch views because InfoPath would get so confused with customized list forms I don't know if you had that same experience but yeah this on view and onstart thing is now the on new works so look see new admission we have admission date working and we have it pulling up the right form it's the new admission form but it's just this Save button that I don't think yeah I completely broke it by putting all that I didn't completely break it it didn't work a second ago good lord chris is just like oh my god what are we doing here but can i edit a an existing one I gotta stop I know see I when I save a new one it works but when I save I go edit that same one and I try and save it it doesn't work so that's what why did troubleshooting maybe we'll bring that up next time now next week we're teaching our four day power apps training class so we are not having Power Hour it is a three hour a day immersive power apps training class that everybody gets their own environment and get to try stuff out get to have q and a's and we all get to know each other really well it's gonna be a lot of fun so that's where that's where I'll be so um but I'm hopefully the new stuff that they just rolled out let me switch back over here hopefully some of the new stuff they just rolled out in SharePoint that they talked about the big sharepoint conference like the new way modern lists are gonna be and some of the new web part innovations hopefully that will be in at least one of my tenants in two weeks for the next power hour so we can demo and talk about some of that that's pretty exciting so thank you all for suffering through this with me as usual we got it mostly working but as you can see if you already have content types this might be something where you have to kind of retrofit some of this stuff and I recommend trying to keep it down to one screen and keeping it pretty simple but if you are creating a new form and starting with a new business process you might not want to go the content-type route because power apps isn't really doesn't really recognize at least right now it doesn't and it just can it's gonna cause more work for you so only use those if you absolutely have to for some other reason other than logic in the form all right thanks everybody for coming and over and out
Info
Channel: Laura Rogers
Views: 8,364
Rating: 4.6491227 out of 5
Keywords: SharePoint, PowerApps, Office 365
Id: RPITzpPlbiQ
Channel Id: undefined
Length: 68min 4sec (4084 seconds)
Published: Wed Jun 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.