PowerApps Deep Linking - Send a direct link to a specific record/screen in your app with parameters

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in today's show we're gonna talk about power apps deep-linking so this is the ability to send some via vine email or other means a URL then not only opens your power apps app but actually opens them straight to the screen that you want them to showing the information you want so you might use this to send them straight to a specific record or for an item they need to approve or some other need that you have not to send them the home of the app but down deeper into the app hence for the name deep linking but before we learn about that first here's our intro hi my name is Shane young with power apps nine-one-one those guys in today's show we're in cover up our apps deep linking this is where we're gonna put a parameter where I'll explain what that is later in the URL so that when we send people maybe an email with a specific URL that they don't just go and open our power app directly but we can actually have them open up our app right to the record or piece of information we want so take them where we need them to be and this is really useful for a lot of our customers use this with like approvals so you know you go and you put in all the details about the expense report or whatever you have and then we start the approval process and so then we send them a link back to the specific your instance of that expense report or your instance of the purchase order requests we send them straight to that screen so then that way they had a big green approve or a big red reject button that type of stuff and be surprised but we very rarely use the flow or power automate approval processes we've been a lot happier with just building our own type of functionality but deep linking is a big part of that so this has come up a lot this is not a new concept Microsoft blogged about this probably two years ago but it's come up a lot recently with our customers so I just started to sit down walk us through a video and show you guys a how it works and then be as always how to build it yourself so let's switch over to my desktop at this table look and so over here my desktop you can see I made a fancy deep-linking a demo app I know I'm so fancy I used a component to pull this in yeah I mean but so if we go in here and choose a record so we'll choose Chewy's record OOP so you can see this is just a normal form right we're feeding this from the gallery we've connected it I put a picture of Chuy and his I've been naughty hoodie my children bought it for him and lost their mind so I thought I would share that with you guys has nothing to the app but fun anyway so what I did here right we can ignore with all the edit new ROI what I wanted was an ability to email a link to Chuy's record so if I press this button Boop we should send down an email and then if we switch over this tab you can see as fast as I got over there was pretty impressive actually here's a link to Chuy's thing and here's the link so click on the link lissa notice it's gonna load her power out for us but instead of sending us deep or to the home screen right it took us straight to Chuy's record and if we were to choose a different person it's not gonna matter right so when you go in here and back alright I'm gonna choose Jennifer hey Jennifer will choose Jeffords record still the funny picture chewy emailing to Jennifer's record and so then hopefully is fast go outlook click on this link and bammo whammo it's still there now users though that if you just send users a link to the app straight up so deep linking demo then it would still just load you back to the home screen so we haven't made it so the app always loads someone's information we've just made it if you get the specific URL and so the way that that really works for go back over here and look at the URL what you're really after is this right here so I put in what we call a query string or parameter added in the URL employee ID equals four totally made that up the employee ID portion but the four number is actually Jennifer's the ID of Jennifer's record so then now that I have Jennifer's records ID we can add some logic in the app to do that all right that's enough explaining how it works let's go over and actually I start deconstructing the app let's close to me the window say it's much stuff open let's close that was close that you guys know me I will get confused here we go okay so over here in our app pretty straightforward this is basically a regular gallery nothing too exciting here now one thing you'll see here that I did it's very important so when you click on the button to navigate to the next screen I am actually going to do a set var record this item so that's going to take whatever record you're on and set that entire record which means that entire row out of your your point list out of your sequel database all your CVS it doesn't matter this this has nothing to do with your data source but it sets the record into a variable called var record and then now we get to read a detail screen so let's hold down the Alt key will choose Gregg's ugly face and so now we get over here this is a normal form the only difference is you guys probably typically use gallery dot selected that's not gonna work in this scenario so what I did what I said hey your item is var record and because both the gallery and the form are showing the employees list right and you don't know you don't know the datasource they can be share pointing to be whatever doesn't matter but they both care to the same data source so var record matches so it's a go okay he chose Greg's record on the other screen and put it in that variable and so then now over here I am showing Greg and if we hit play real quick right we can still edit this Mike hey Greg's favorite color is clearly blue that blue shirt he's wearing so we can say save notice my fancy little buttons boom we can still create a new record right this is just a normal form nothing special about it the only difference is instead of saying gallery dot selected like you're used to we're just using the VAR record okay so now that we've got everything loaded in var record like if you go up here to the top in my the text for this right if we go to the header text and this is a component that I showed you guys how to build in a previous video so I just thought it was easier to pull and get my app looking nice without me doing any work which is what's great about components but here you can say if form 1 mode equals new show write create new employee if not do details about far record first name right I'm just trying to reinforce with you that var record is truly Greg's whole record and so the first name field from Greg's record is Greg they're new and so if you look down here I get this button before we look at the on select let's just look at the text for it real quick same thing email link to var record and first names record so we're just once again driving home var record has the low and current person's data in it ok so now that we understand that what we're going to need to do is we will make this button do something so now I will show you on select and we'll break that down so when you click on this button what are we going to do we're going to office 365 Outlook send email v2 right remember anytime there's a v2 or if you're watching this video you're from now there's a v4 whatever use the latest V but so in this case this is v2 and so for the two line we're using the text input 1 dot X so in this case Shane at power apps 9-1-1 comma here's a link to var record aka Greg info so that's one of the subject or instance here's a link to Greg's info and then down here we're just gonna write some HTML here is just the a is a anchor right that's an HTML concept and then the href is the URL of my app now yours is gonna be different right and how do you get that you go over here and so here's my app I must say details so I just copied this whole URL got it and pasted that in here so HTTP bla bla bla bla bla bla bla bla bla bla bla bla it's a little bonus thing I added this ad hide nav bar equals true you can ignore that for now but that's what makes the chrome at the top go away kind of neat fun little trick and then so what you're really here to learn is I added an ampersand which means I want to do another thing in the URL because there's already this question mark and then tenant ID equals right there was already a parameter in here that was my tenant and so then now what we're doing is we're saying employee ID I totally made this up you could have made it towels you could have made it chewy whatever you just write something up here I said EMP ID equals var record ID that is Greg's current ID right to highlight it and see it and then I close that out and then I made a link and then I just finished out you know because Shane is lazy like chewy so that is all I had to do for the email that I sent out I just made up something in this case EMP ID now and keep in mind this is case sensitive I didn't realize it was case sensitive until I was practicing for this but it is case sensitive so employee ID equals that ID boom boom boom boom alright so that is what is sending our email so then now that we're sending an email with a link or with a a parameter for employee ID we've got to grab that parameter out and do something with it right if I just send that to an app that doesn't know what to do with it it just ignores it it would later already spread oh you you wrote that up there how cute you know so what you need to do is up here on the app on start this is where you were going to do this okay so what I'm gonna do is this first things I want to say set var employee ID or var EMP ID whatever some variable I just made up to parameter employee ID so this section right here that is what looks in the URL to say hey is there a parameter called EMP ID remember capitalization is important if there is grab that value out so in our case is for Greg it's going to grab the two and then it's gonna grab the two is text and I need it to be a number so I'm going to use the value function to turn the text to into the number two so then that means that var employee ID would be set to two okay and if if you did the thing where you just clicked on this URL straight right there's no employee ID in here so then it would be zero all right there's no employee ID present then the blank text will get turned into the number zero that's important because now what I'm going to say is if our employee ID is not equal to zero so if it's anything other than zero so in this case it's two then I want to set var record ah remember var record that's the thing we did in the gallery to get the the record out of employee so we're gonna set var record by doing a lookup to the employees data source where ID equals var employee ID - so go to our data source find the record with ideas to which we know is Greg's record yay and then we're going to navigate to the detail screen if VAR ID have equal zero then we just skip this whole step so that's how the app now knows when it opens up whether you know if it finds a number up there - for 217 it's gonna do all this and then navigate them to the detail screen if there's not a number up there great then what it's going to do is it's just going to drop them on the home screen like it always has and that is how deep-linking works right that that is it it is no more applicator than that I you know I know that's super simple because your goes alright written yeah so we're gonna write this together but if you followed all that you probably ready to go do deep linking yourself but if you're not cool stick with me here and let's go over we're gonna build our own version of this but this is pretty straightforward so right so go to Rome I'm gonna go over here we'll say hey apps I want to do a new canvas app and so after a second the screen loads we'll choose a tablet layout right it could be a fun way out I don't care but I like tasks it makes it bigger easier for you guys to read see more screen real estate blah blah blah blah okay so now right here now the first mistake that I made for like the hundredth time today summer remind you guys well public service announcement remember to go ahead and just you know give your app you know deep link oh my goodness is a mall getting in deep link video so we're gonna name her app then when we hit save it hit save all right because now autosave will kick in every two minutes I might have built this app yesterday and forgot to hit save and had to rebuild again this morning it might happened also remember the upside the reason I'm trying to save these is because if you're a subscriber to my curated content library you can download both the app I just demoed and this app are about to build together so you don't have to redo all this work yourself you just grab my version of it and then you know fit it in your environment so whatever that's worth alright so what we're gonna do is first thing I'm going to do is insert a gallery vertical and so for data source I'm going to use SharePoint why because it's easy and I already have the data there but once again this concept has nothing to do with video what data source you're using so I'm going to choose our good friend the employees list you guys are probably so sick of seeing these people spaces may I should replace all their photos since we've been doing this for a long time and that was a skinny chewy face right now and she's got fat chewy face whatever okay so now we have our gallery so then what I'm going to do is I'm gonna throw a second screen in here so so a blank screen and we're just gonna call this details screen just to make this no no easier to and so then on this screen what I'm going to do is I'm going to add it form never a display for him I hate display forms display forms in a devil so with employees this kind of make it a little bit bigger whatever right we're not worried about what it looks like we just wanted to to fit okay so then now before we can set the item property or I can gotta set an item property here we don't want to use the gallery selected so we go back over here and so I'm gonna say hey you what I want you to do is set of our record and I always name it var record just because it's a nice pattern for me but you don't have to use that name this item and then I want you to navigate to the details screen like so and in case you're wondering this is whole set bar record this item I use this in all my apps whether I'm using deep linking or not it just works better it's much it's a much cleaner much more performant and also you don't run the risk of your data source changing in the selected item changing so in all my galleries I never use gallery not selected in the real world I actually always do set var record and then this item and then go do whatever it is I want to do the gallery so hopefully that little tip helps you guys out I've been trying to make fan a way to make that into a whole video but it's not a whole videos worth of information so for watching this one you learned it okay so then now that that is in here so then now I can click on my record OOP so it takes us over here I could expect and so then here you're going to set the item property just to Bart record there it is okay so now we've connected our two pieces up so we're going to skip the whole editing saving forms right you guys have seen that I've got different videos on that if you nee that was just leave me a comment I'll look you off to it but the channels full of that stuff so I'm gonna sew a button over here and so in this button what we're going to do is we need the outlook data source someone quick a little data over here I'm gonna type in outlook office 365 outlook is perfect little pop up so go away there we go and so then now I want to start writing my email so it was not all it should be oh it didn't take it sounds like what happened a stupid pop-up keeps getting in the way Microsoft or there we go okay so then now what we want to do is we want to do an office 365 Outlook and then I'm going to do sin and so send email b2 is the latest once that's what I want to use so for two I'm just going to hard-code it to Shane at power apps 901 calm subject we're just gonna hard code that one to subject goes here and so then for the body we're just can put in body goes here for a second we need our URL but I don't have the URL yet right so the way that you get it is you have to have saved your app remember we talked about that but if we go back over here there's a deep link video so then you go here you go to details and so then you copy the URL right remember you don't want this URL yours to be different than mine so then there that goes and so then now was working on the body so the body all we're going to do is just put in a simple link so we're going to do a and then it is H ref and then equal sign a single quote paste that URL n close your quote and then close your bracket right I know this is looks terrible make it bigger thank you so there's that there's that and so if we close that it's like alright that would be good so we'll go back inside here we're gonna say link and then we're going to close right right just like so so then what that should do is I should send me a link straight to that that app right so no deep linking just to straight in so what I'd like to do right now is test and make sure someone just hold on the Alt key press the button and then we'll jump over to our email subject goes here link and click on this and just make sure this opens your app right because right the app is blank one is the app point because that's the same version I saved it was completely my and republished but what that tells me is that my URL is correct because what I don't want you guys trying to do is to write your first you know employee ID type of thing and not make sure that it worked right so baby steps so now that I know that's good now I'm going to add an ampersand and so instead of EMP ID I could be the last time we're gonna call it Chuy ID just to show you guys I can literally be anything you want so chewy ID and we're just going to hard code it so we're just gonna say chewy ID equals 2 okay so now I'm gonna do that and I'm gonna press the button but before I press the button what I want to do is I'm gonna go you know now you know what we're just going to press a button just make sure the URL looks right it's not going to do anything yet but we're gonna make sure the URL looks right so we're gonna press the button we'll go back over here and so we'll click on this and I just want to go up here and check so right so we haven't told it how to process it but you can see that that came through because what I'm trying to get you to do is to understand the pieces all right so there's a chewy ID equals 2 so then now we know that this 2 portion needs to become dynamic so delete out the to do a closed quote hit the spacebar and do another quote okay so you know the 2 needs to go here and so to do that we're going to save our record dots ID and another ampersand and so there it is so we replace the to write the number 2 with that and so in my case my ID is I have no idea of my ideas I see my ID is supposed to be well we just hover over this don't tell me Shane's ID is 3 okay so then now let's press the button let's go back to mail let's click on this link go to the end ID is 3 ok success so we're now able to send the URL or a ID in the URL so we've done the first part ok with me so far I'll bet you are probably saying go faster Shane which is fair but I'm trying to get make sure that everyone understands I've taught this to a lot of people and some people would take schooling for the light bulb to come on on this one so ok so now we go back to my home screen so gallery one is that what we're going to do is we're going to go up here to app on start and so we got to do two things here so the first one is we want to say set VAR employee ID we're just do it like that bar set bar employee ID and it's going to be parameter alright so pram and then you have to make sure that this is capitalized the same way so I would probably go back right now so I did it Chuy ID there I'll get back to this button Chuy ID okay they match good job Shane so now that they match so we would close that but then I would remember that that's going to grab the sound as a string I don't want it to be a text to I need to be a number two so I'm going to use the value function to turn the text to into a number two and remember if you're comparing off of a different field type you might not need to make it a number maybe you're comparing text to text maybe we're doing it based off names you know if that's your primary key nine times out of ten your primary Keys a number so that's why I went ahead and made mine a number here but it might be different so then now I'm going to do that and so then now we're going to do is were going to write that if so we're gonna say if hopefully I just got that Chuy barking edited out he heard his name one too many times and cuz started barking ah anyway all right so if bar employee ID is not equal and that's how you do an on equal to 0 because that previous step is either going to put in in our case the the two or the four or if it's blank is so in the case of them just launch the app it would be zero so like that and so if it's true what do we want to do we want to set far record and we're going to do a look up from our same data source where the ID equals var employee ID the ID that we just passed in makes sense to me like that we'll close that and we'll close yeah nope but before we close our if what else we need to do we want to do a semicolon right because we need to do another step and that is navigate to the details screen so load the record in and then navigate to the detail screen we're going to display it it seems pretty cool to me so the other thing I might do here just to make our lives easier right the labeling screen when you're testing tryouts going on and just be a gay what is VAR employee ID and so then that way we can do something like this ID so in that way we could see that come over so I'm gonna copy this out this on this other screen here I'm just put it down here at the bottom somewhere alright it's not some is gonna make it in the real app but it would help you maybe troubleshoot the other thing that I have to do when I'm troubleshooting these things a lot of times I'll just put like a label down here in the bottom corner and then I will do a v1 because if you're saving and publishing over and over again you want to make sure that you're seeing the latest version so I'm gonna say save and then we'll publish alright so now that that's done if we just come back over here right we just grabbed this link from earlier because we know the link works click on the link and so when get brought here to the white screen where does that tell us well that tells us that we're still loading that previous version of the app so our published versions not there yet so I'll hit refresh again okay so look at that first try yeah right pretty exciting stuff right there because what happened you can see the employee ID got it set to 3 and we automatically got sent here but if we go and launch the app with the old URL the way you guys been doing it forever what's gonna happen here look ID is zero and so we don't get sent anywhere but if we go back in or so now that we came in through ID zero let's just go click on Daniel's record kind of looks a little spooky he needs a Christmassy picture and so let's send a record of Daniel off so we'll say button Boop we'll go over here to my mail and so then link and after a little bit of dramatic pause we are loaded straight into Daniel's record ID contain his record 64 clearly have a bunch of records out there but there you go so that is how deep winking works now the other thing I can offer you guys since you stayed over here the other thing you might do Juke is so on this button so now you have this URL working and you're totally cool what's happening go right here in front of the whole Chewie and what we're going to do is we're going to paste in our cute little hiding of the navbar sorry do not mean to click on that and so what that's going to be I enjoy steal from there so go over here to this app real quick and steal can I steal for my code we're gonna do this hide nav bar equals true so copy that out and so then right here in front of Chewie because it only mess up Chewie so it's gonna be amber san hi nav bar equals true and so now if we press on that link alright so we'll send it off to I'll hit play well I'm gonna send my record it doesn't matter we'll go here there's the new email click on the link and so what you should see is look at that now we don't get the the bar at the top anymore remember all these other ones we were getting the pig purple normal bar so the hide nav bar just another one bonus whole things I've been trying to teach forever but that's it folks if you followed this you know how to do deep linking now and so like I said nothing new here Microsoft published an article on this a couple years ago just seemed like a video that was overdue to be made so if you have any questions comments leave me notes below remember if you subscribe to the curated content over at training power apps nine-one-one calm you can download this app and all the other apps you can watch the videos you can download the videos and get the code snippets that's a fun to be had over there so go sign up over there or even join us for office hours where you get to have private little chats with me so big fun I think with all that I'm just gonna say thanks and have a great day before you go be sure to click on the subscribe button over here that way be notified when new videos come out if you need any help or you want to work together whether your problem is big or small check us out at power apps 9-1-1 we do it all around or if you're looking for more formal training offerings we have those that lean to appear somewhere so check them out thanks and have a great day
Info
Channel: Shane Young
Views: 115,467
Rating: undefined out of 5
Keywords: Shane Young, powerapps911, powerapps deep linking, powerapps parameters, powerapps parameter url, powerapps param function, powerapps param url, powerapps deeplink, power apps, learn powerapps, shane young powerapps, powerapps, powerapps url parameters, powerapps query string, microsoft powerapps, powerapps tutorial, deep link, powerapps tutorial shane young, powerapps deep linking video, powerapps training videos
Id: A5Pi5P2YKds
Channel Id: undefined
Length: 26min 45sec (1605 seconds)
Published: Tue Dec 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.