The Ultimate Guide to Power Apps Deep Linking

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
have you ever wanted to be able to send someone a link into your power app that would open them up to the screen and the record the exact place that you wanted them right so we call that deep linking so in today's video we're going to walk through how to set up deep linking in your power apps we're going to take an existing power app that's got a gallery and a form we're going to have to reconfigure it a little bit to accept deep linking and then we'll go make the configuration changes and at the end we'll kind of talk a littleit about some of the other ways you could use these deep links now this is all based off of a video that I made like four years ago that has like 100,000 views so hopefully I do as good a job this time let's switch over to my desktop take a look okay so first things first let's just check out my beautiful app well beautiful app other than until I put the big green button over here but you know close enough right so all I really did with my HR Pro System here if you hit start it shows you a list of different employees and then you can go in here and choose let's choose chewy and then right we've got a form here we can edit the data manipulate it and save it right so pretty typical um format right like a gallery connected to a form and so now what we want to be able to do is we want to be able to say hey when I go in here look at Greg's record we want to add an icon over here that sends an email to whoever we say and when they get the link in the email it takes them not only to our power app but we actually bring them back to Greg's screen right here right so that's we we want to build now before we build that I just want to kind of point out that we need to kind of fix things a little bit here right I built this the way is most typical what we see the most and like if we look at this G uh this form you're going to see that the item property is currently set to Gallery 1. selected right we go over here as you can imagine this is Gallery 1 so whatever record you clicked on over here that's the record that is showing up over here in our form because we're using gallery. selected so this is the first thing we need to change in order to do deep linking and honestly gallery. select is something we don't really recommend ever so what you're going to do is you go go over here to gallery and so right now this is the button that takes us the other screen and we're going to add a second thing here we're going to say I want to do set bar Rec record to be this item and then we'll put a semicolon at the end and so what that's going to do is that's going to create a variable called VAR record by using set it's a global variable it means it's available anywhere in our app and we're going to just take the entire record the entire row of information and put it in that variable so that's all we did right one change there but now if we hit play right if we click here right the form still works the way it did but now what we want to do with the form is instead of gallery. selected right that's a record and that's Nicole's record right it's we see all Nicole's data all we're going to do is we're going to change this to be VAR record and because it is a record from the same data source the employees data verse table then boom right like the dots are connected so now the app works exactly the same way the only difference is instead of what you select in the gallery driving what shows up in the form it is going to be this VAR record and so this is a concept like I have a whole video on it I'll put a link up there like that talks about the importance of our record and the cool things you can do is you start to use it but as you get more advanced in power apps you start using a gallery do selected less and less because you can't control it we need to be able to control this right so when we do the Deep link we need to be able to set the VAR record so when they click on Greg's picture it brings them over here but we can't do that until we update this okay but yeah so now if we hit play we go back right speaking of Greg let's click on Greg's record there's his ugly face again right back click on me there's my beautiful face right so it works the same but that's the first key change is you have to make it so you can control what data is being used and this deep linking doesn't have to be done with forms only so if you're using patch right whatever methodology you're using to popular like this you just need it to be variable driven so that way you can change the variable with your deep link so now what we want to do is we want to add a icon over here to do this okay so what I did here is this is actually a container let's kind of collapse these I did a vertical container and so when I add something new it just pops over here right so if I say insert we'll search for send we put that in there and look it just drops in there the gallery respes itself all of that is configured automatically based on the settings of the container right because you can't move things inside a container individually if you want to change them you have to CH click on the container and change its Behavior altogether right okay so that's in there but now the great thing is and notice here I had a little fun with my container we're not going to get how I did it right but say edit like the icons change but these two icons always stay the same if we cancel boom right it's always kind of moving back and forth we're we're manipulating that on the Fly giving a little bit more of a dynamic experience to our users and if you're interested in this app right you can download this whole working app with the Deep link and everything the data verse tables all is a solution you just go over to training. powerapps 911.com and sign up for the YouTube Library all of my app downloads are available over there right also a lot of great training classes you should probably check out anyway back to this so now we've got this now we want to be able to send them a link to this app okay so to be able to send an email with a link right we're going to go here to data we're going to add data and we're going to search for Outlook after several seconds it finishes loading and I can click on Office 365 Outlook and choose one of my connections they're all the same doesn't matter okay so that adds Outlook into here and so now on select we want to be able to send the user a link to this app now in order to do that what we're going to need to know is the URL of the app app so make sure you've saved the app at least once so we'll hit save just be sure and now if we just jump back over here we're going to open a new tab and go back to the power app studio and now there's our app we're going to hit the ellipses here and we're going to say I want the details here are the details you have the web link this is what you were looking for right so copy this this is the same URL that you've been sharing with people forever so we know we're going to put that in the email okay so to write email we're going to do Office 365 outlook. sendemail V2 and for right now we're just going to send it to the logged in user which is me so we'll do user. Emil we'll do a comma here subject will be like deep link and then for the body all we're going to do right now is just send the link but remember that the body can be HTML so we're going to put a little HTML in here we're going to say a and then href equals single quote paste in that crazy URL close your single quote close your bracket let's make this bigger so it's easier to see and then now we need to say okay inside the a we're going to say click here and then we're going to to close the a okay so if you're familiar with HTML that's pretty straightforward if you're not it's okay right remember chat GPT can help you W3 schools if you're having a hard time with the HTML but you can just copy and paste exactly what's there other than your url will be different than mine uh but that should take you there that looks good we'll go right here we'll close our function everything looks happy now this isn't connected this isn't going to take them straight to any specific record but this should generate an email and we like to fail fast so we want to test this so we're just going to hit play and we're going to click on this and then now I'm going to switch over to my email real quick and there's our email and you can see here it's you know says deep link there's a subject it's from me want press the button it's to me because I was one in the app and then if we say click here this is going to open up a new browser Tab and it's going to take us to the home screen okay so that's step one make sure that you can send a email that opens up the app it's not our end goal but that's the first step okay so let's close all this so we don't get confused by a minute so now that we've got that working now what we need to do is we need to go back to this and we're going to need to add a parameter to this right so a parameter is just a additional part of the URL that things like power apps knows how to look up there and we're going to tell it to we're going to send it an employee ID it's going to find employee ID up there in the URL and then make that available to the app so for right now we're going to hardcode that and what we need to know before we even try to hardcode this is we're going to edit our form real quick edit fields and we're going to add the ID here okay now because I use dataverse right so in this case it's going to be the field that matches your naming here so here you can see like employees video so when I originally named this table I called it employees video now it's called employees data verse which changed but if you hover look to the right there you see it's CR 662 employees video ID that little last piece that's what's telling me that hey this is the ID field that we're looking for so we're going to add this now when you add this to your form you're going to see that it is not editable right because this is the primary key if you're using SharePoint it would have been the ID column if it was SQL it would have been whatever ID column you generated but typically you know um data verse is a little more complicated because it's this big long number whereas SharePoint would have just been the ID column either way that's what I want so we're going to try to create a deep link to me so I'm going to grab this and copy it right making it a little harder on myself by using dataverse and so now we're going to go up here to our URL now you see and Source time equals blah blah blah right like that right there is a uh parameter that power apps at it we didn't do that but it's there so we just kind of have to replicate that same thing so we're going to say amber sand right we want to add another one we're going to call it empid you can call it whatever you want like make it say cow or buddy or Shane is awesome man probably not Shane is awesome but you can put whatever you want there I'm just using EMP ID because that kind of matches what we're doing and then we're going to do an equal and then we're going to paste in that hot garbage that we just copied right that's a called a guid but there that is there and so now that we've got that in the URL we can now send the email it's going to have this in the URL and it's not going to affect power apps yet but we're now passing a parameter because we're passing a parameter if we want to get that parameter out out now we need to go back over here to the app right so the app object over on the left and we're going to go up here and say Hey you have an onstart property right onart is stuff that happens when this app loads before the rest of the things happen right so this happens before anything else happens for your app which can delay loading but in this case we want to delay loading because we want to know we want to grab this out before anything else happens so what we're going to do here is we're going to say set and we're going to say VAR EMP ID right same thing keeps it easy for us comma we're going to use the pram function and then we're going to say hey pram function I want you to look for EMP ID up in the URL all right so whatever you're put up there right so if you typed Cal or you type Shane is dork then whatever you put up there that's what you need to do right but now that's there so now that I've got that there we're should have a new variable with this in here we're going to copy we're going to go back to the welcome screen we're going to throw a label on here goodness gracious if you ever take training classes with me I love labels right they're a great way to prove things and so all I want to do now is see oh let's make that bigger though because we know that thing's giant we'll say scroll just in case you need to get real big but we want to see does that crazy good show up here now when we do the app now you're thinking before I do this I need to save yes but you also need to publish right we need to make sure that we've published and so before I do that other thing I'm going to do to help myself I'm throw another label down just leave it up here and we're just going to put this one we call it V1 okay so the idea there is that when I see V1 I know I'm on the version of the app that we've done okay so let's hit publish publish this version now if I was you I would probably wait 30 seconds a minute two minutes I'm going to try to go fast because I don't have patience but you should wait so you don't have to troubleshoot too long right but all we're going to do now is we're going to hit play we're going to dive in here and we know that we're sending mine right to that nine blah blah blah so we're going to click on this button okay so that should generate email so let me switch my email real quick okay so there's the email now if we hover before we do anything right look in there you see that I see Amber sand Source Time blah blah blah and EMP ID and I see the blah blah blah that's probably what I want so we're going to click on it it's going to open a new app now notice right away the V1 is not here so don't be upset that it's not working right v1's not there so this is the old version of the app and power apps is actually enough now to tell us it used to not be but that's okay so we haven't messed up yet so let's hit refresh it's now once the Outlook connector whatever allow one of my students was complaining this week they're seeing that allow message a lot more but look there's the V1 and more importantly there's our guid yes right we have passed information via an email and gotten it back into the power app so now that we've got the information now let's figure out how to action on it so let's close this window again right I keep CL closing these I don't want to accidentally open the wrong want to get confused and I I keep telling you all these little things because I've you know like I said the other video had 100,000 views and probably had over a thousand comments and a lot of times when people struggled they went too fast they skipped steps they didn't just take their time right that's why we're trying to take our time as we go through this okay so now what I want to do is twofold right now let's just do onefold so now what we're going to do we go back here to the app okay so that is now getting our employee ID so now that we have it we want to do something with it right we want to set VAR record to be that and then we want to take them to the screen so they see my beautiful face okay so we're going to do something like this we're going to say if not is blank for employee ID right so that tells me that an employee ID came back so if it's not blank what do I want to do I want to lookup actually I want to set VAR record let's move my cursor out of the way and I want to do a lookup to our data source right so in our case employees datae but whatever yours is called and I want to look up where the employees videos right so whatever that fancy column was it was your primary key remember it's going to be different for all of us but for me it was employe video right that was the name of the primary key equals VAR EMP P ID now if I close that and close that and close that we should be able to do it now oh we got an error right now go hover guid values can only be compared to other guid values okay so we passed it a guid right but we passed it when it we did that set bar employe ID it turned it into a string strings are not guids even though they are um so what we need to do is we need to go back up here and we're going to say Hey you we want to use the guid function around you to turn that string guid into a guid guid by turning it into a goid goid we're going to get this right if you were doing this on SharePoint what would you be passing you would have passed a number right ID is a number so you would have passed 12 you would have been reading 12 and Devar employee ID as a string one two not the number 12 so you would have used value here right and then down here it would have been look up SharePoint table ID equals VAR employee ID but instead of guid that one would be value if you did SQL Server I don't know what you did you probably did a number it's probably like SharePoint but that's on you okay so this should set VAR record to be what we want so now what we're going to do is we're going to go back over here to the home screen and so we know that this label worked right but I'm actually going to leave it here and I like to leave these here because I want to prove all this we'll delete all this later right copy paste we're going to put this one right here and we're going to say hey I want you to be VAR record and then we're just going to do like first name right so if we see Shane then we know we're in good shape look at that it's already there okay we're going to change this to V2 and that's because I'm clicked on change record right V record's already populated so now what do you need to do you need to save and publish again don't skip this step right that's another common mistake okay publish this version okay now because we didn't change the email at all I'm just going I don't even have to generate the email again right we can just click on this link again and by clicking on this link it's going to open a new browser tab look it still says V1 the URL doesn't control the the version in any way right so it's just going to say that so we're just going to do a refresh here and after hitting refresh a couple of times finally look there's the V2 that's why we put the V2 there so we knew we still have our ID and more importantly there's Shane right so we populating bar record with the ID that we wanted yes we are doing great okay now what we need to do is we need to send them right they're on the home screen this is not helping so now we want to navigate now this is going to be a little trickier here so let's close this right we don't want to get confused so what I want to do up here is I want to say hey after you set this variable right so that would be right here what do I want to do I then need to navigate and what's name of that screen is called edit employee navigate to edit employee we'll close that close that and that now when I do this we get an error you hover it's going to tell you navigate is not permitted on in on start use the start screen property instead okay so this is where the controversial part starts right so what you're going to need to do is you're need to go here to settings you're go to upcoming features and retired and so what's happened is Microsoft has disabled the ability to put navigate in in app OnStar unfortunately as far as I'm concerned to do deep linking right today right as of today still the only way to do deep linking correctly is to go ahead and go here and turn this on okay so we're going to turn it on okay now if you're thinking but Shane why didn't I do it you know another way so Microsoft has thoughts of how they're going to change it uh like if you go look on app and there is now a start screen so you're like hey I could do all this start screen not have the error you can but in start screen you can't set a variable and so if you're all of a sudden trying to set variables here and then have the start screen do the navigation it can work but it can also create what we call Race conditions where once trying to get done before the other and it can cause confusion um there's other little clever things you could possibly do I don't like clever I like things that work consistently so as of today I am still encouraging people to turn off that feature for deep linking apps and write the code this way if you want to do it another way well watch a different video no um you know you you definitely can find other ways but this as far as I'm concerned now at some point they will change it and my opinion on this will change but you know as I stand Here on October 19th 2023 this is still the right answer to me and I don't think they're going to change my right answer for a way to come so if they ever do I'll leave a comment uh I'll pin a comment that points you to a new video changes how to do it but as of today do it this way okay but now that we've got this now what should happen is if we click on V over here we're going to change this to V3 and we're going to publish again now what should happen is when they click on that link it should not only load all that information but it should also grab and send them to the edit employee screen and load up Shane which is what we want right we'll be almost done so go back over here because we haven't changed email we can just click on the same link again so let's just click there right V2 loads so I will hit refresh until um you know I'll come back in a sec Tada right now because V3 is here we don't get to see any of that because it literally just takes me here right like I'll click it this time without editing right says click the button and it just drops you here and takes you straight to me yes now you probably don't want to hardcode it to me I get that I mean might you want to hard code to me I think you should but but if you don't let's go fix that now right now that everything works and we started with the easiest path possible so let's go back over here so now instead of sending them always to me let's send them to whatever person they're on so like if we're on Chewy's record how are we going to do that well we know that this portion right here is what is sending them to me right but we don't want we want that to become Dynamic so let's delete that out and now what we're going to do is we're going to have to double quote and Amber sand and then double quote right so where this Amber sand is is where you need to dynamically put in the ID now the easiest way I think to probably do it in this case would then just be say VAR record Dot and in case for me right because my primary column is called employees videos that's what I would put and then we throw an Amber sand after it and we're set right if you're doing SharePoint bear record. SQL VAR record. whatever you've done um if you're state oforce it is your primary key column andless so let's just go look at that for a second right I keep telling you M's employees video but how do I know if I don't know right click on data and then say you're edit your data here nope you know what this screen is not going to show us efficiently so let's X out of here let's go over here let's just open a new tab go find your data verse table and you could go straight to the solution right mine's in a solution but yours might not be so I wanted you to see this and so we'll find employees data verse right that's the table we've been using click on that click on columns and what you're looking for is what column is called the unique identifier right this is your primary key this is the column that we care about in all this and so that's where I can see that mine is named employees video and then that is that CR 662 thing that we talked about earlier okay so this is how you would find yours in data verse if yours if you're struggling back over here so now what we should see right because we've edited all this so now we going to need to send a new email because we want to get the new email maybe we'll go up here we'll say say deep link for and then we could do this right Amber sandar record. first name okay make our email a little bit different cool cool cool okay let's save and publish again now I guess before I save and publish let's follow my pattern let's be a good boy right go back here to V4 now what we're really headed towards though is we're going to be able as soon as we're done right we're going to delete these we're not let's just be careful let's not delete anything yet all right so there's publishing now that it's published we will say play and we will go in here we'll go check out Chewy's record and then now we're going to click on the email icon here's the email I got you can see deep link for chewy and if we look in here like we notice the numbers are different from PO ID I don't know right we'll say click here opens up a new browser tab straight to chewy there you go we have created a deep Link at this point you've got all the pieces of the puzzle now look it's saying refresh why did it work right because the all we changed with this button and so we clicked on that so it doesn't matter right but if we refresh it's just going to take us right back to chewy so no big deal right allow again and any person we want so you know if we hit the back arrow here and we go to Jennifer send the email there you go deep link for Jennifer click here there's Jennifer's record perfect okay so deep linking is very cool I know oh yeah don't forget if you just want to download this whole working app right it's a data verse solution so you'll just be able to download it it have the tables the app would all be functional you just be able to plug it into your environment you can do that just right over there at training. power apps 991.com also things that you might be thinking about for changing the app so right now we know that I am sending the email always to the logged in users I'm basically sending a link to myself you could change that right so if you want to have a place for them a text input for them to type in the email address or if you want to look up their manager right like that portion just wants the email address you want to send there it doesn't care if you get it with a function a lookup an input a drop down however you want to get it grab that also another question I got uh from one of my uh office hour students this week right like so he wanted to do all this but he's like hey I see the email I've seen that video from four years ago but now you know he wants to use this with power automates right no big deal now that you understand that this URL does what you want to do your business so I could go stick that URL and power automate that would work right so he could write a flow that says every time an item gets added to SharePoint send an email to someone right and he would just go into the HTM body of the Outlook action he would put all this in there and then when we're doing VAR record um employee video he would do Dynamic content the ID from when the item was created boom he's got the same thing if he wanted to build a deep link inside of powerbi same type of concept right now we'd have this URL we just need to take this URL concatenate their ID and make that a clickable link in powerbi boom deep linking from powerbi this URL just needs to be what this URL needs to be it doesn't matter how you get there it could be hardcoded it could be in a teams message and an email and sent by carrier pigeons so much you can do once you understand these mechanics so thoughts questions comments leave them below I'm all ears right this video when I remake it in four years again from now it'll probably be totally different but uh these those comments help me do that right also if you enjoy this style right check out our training classes I got some live training classes coming up training. powerapps 911.com you know love to see you come hang out with me for five days and do some back and forth and learn all this together all right and with that I'm G to say thanks and have a great day
Info
Channel: Shane Young
Views: 16,451
Rating: undefined out of 5
Keywords: Shane Young, powerapps911, PowerApps, Power Apps, powerapps deep linking, powerapps deep link to record, powerapps deep linking email, powerapps deep linking to screen, power apps link, powerapps link to item, powerapps link to specific screen, powerapps email link to specific screen, powerapps dataverse link, powerapps tutorial, powerapps tutorial for beginners, power apps microsoft
Id: olJWU756tl0
Channel Id: undefined
Length: 26min 18sec (1578 seconds)
Published: Mon Oct 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.