PowerApps Combobox - Search, Filter, Default values, and more

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in today's show we'll talk about power apps combo box example so one of the controls that get asked about the most is the combo box because on the surface it just looks like a drop-down control that does a lot of better cool or easier things like search and lookups and show multiple fields but underneath the covers when you start to configure it you find out there's a lot of moving parts it's a little more difficult so today's show we're going to walk you through all those moving parts around the different selected items versus a selected item and multi values and data sources all those fun things that you guys been asking about but first here's our intro hi my name is Shane young with power apps nine-one-one those guys and today's show we're gonna dive into the power apps combo box so it comes up a combo box right there's a lot of things that go on with it and it has a lot of really cool capabilities but is that terrible movie quote is used all the time right with great power comes great responsibility we're gonna also have to kind of deal with some of that so this has been more than once I've gotten the most comments and tweets and things like that about so I thought we just dive in and talk about things like the search fields the filters the default values how do you get data out of there how to get data in there right there's a lot of these little things that I just want to kind of go through in this particular video we're going to focus on the control and so we're gonna use probably a sequel data source we'll use office 365 as well tell all that maybe a little bit of a people picker action what that looks like and then the idea is I'm going to take this video and hopefully build on it and follow up in the part two they'll be focused around using the combo box with just SharePoint cuz it has a whole different set of nuances to it but either way you need this video to kind of get you moving in the right direction all right that's enough setting the stage I got all the Christmas stuff right we're gonna get this video done before Christmas comes so let's just jump right in and take a look okay and so over here on my desktop I have a quick example because one of the things I realize you guys enjoy is if I give you an example of how a control or something like this works before we actually go and build it so I made this quick one and so right here on the Left I've got a combo box and this one if you hit the drop-down right you can see that we've some different data in there so a bike store and what it is the right I've added a controlled it is a drop-down that has the same exact data but one of the neat things here is I could search so we can type in store and so then now we're going to only see the results that have store now notice it does take a little bit takes a few seconds so remember right keep in mind that this tool will help you with larger data sets so if you're like I have two thousand things my drop-down which comes up way more than I expect this works this will help but the challenge becomes you know do you know your users really want to wait for seconds after they hit search there so but now you can see I've got some different ones I can select them so they're you know I've pulled a couple back so a bike store our central discount and underneath here this is just a label I threw on here to show you how to get the data out right so we're going to talk about how to pull out so even though I chose a bike store I only pulled out the salesman's ID because that comes up a lot as well as we start to build more relational models and even if we're using SharePoint a data source people are starting to understand that and the real power is connecting multiple data sources and so we have to understand things like the user wants to type in this or search for by company name but to feed the downstream data I need to pull an ID column out or a salesperson column or something like that alright or is the drop down over here on the right it's just your plain old drop-down same data but we got associated bikes and it just shows us that one person also right we can get rid of these things and notice I messed up here I'm showing you the same field twice but you can even show two fields at the same time within here so a lot of fun that we're going kind of configure with combo boxes now I will give you the caveat that when we're going to deep dive into these I don't use them a lot because there's so many moving parts most of the time I try and make my data sets really small you know so my users are choosing out of five or seven items and dropdowns work just great but you might your mileage might vary so all right so let's close out of this and instead of trying to reverse engineer I did here let's just create ourselves a new screen and we'll start with a nice blank canvas to help you guys and I guess step one will be is insert a drop-down or as I drop down the combo box so do you add a combo box you will notice that it defaults to the combo box sample we don't need that data we hit the drop down here you can see all the data sources I've already added in my app and so for this example we're going to start with a sequel table that I added for no reason rice is not anything sequel specific just sequel what I want to demo this from today okay that's my data source so then it's going to say alright what type of layout do you want so they're single there's double write which is going to show us two pieces of data and then there's a person one and really what the person one is it's going to do the two fields plus an image so we'll probably look at that here in a minute but it's a little bit different okay so let's start with a double though I think that one's the most commonly used so we do a double so primary name one do company name and secondary text we will do our sales person and in the search field so this is saying all right what field with a user starts typing you want to search in so right now we're going to take the default and just be like company name okay so that looks great let's hit play and so now if I hit the drop down here you can see that I see the company name and the sales person and if we do a search for cycle we wait a couple seconds right because I think that one has almost a thousand records in it so then they're all of the company names that have cycle in there and then we can choose all right we want Jillian and joses boom okay so then now we've got two items select in the combo box got it good so one of the things you might say is well what if you only want them to select one item that's a fair question so one of the settings that we need to talk about for a second as first you got to click on the combo box is there is a button down here for select multiple now button a property and so select multiple is set to true by default if I set this to false then what will happen is it'll only let you select one item so if you truly want you to be more I could drop down where they only could choose one of the options in there then select multiple is going to be set to false okay but that's no fun for a demo so we'll set this back to true boom alright so then now I was talking about how to get data out of there for a second so if I don't label on the screen because this is how I figure these things out right if you're ever like me and how Shane learn all this stuff I just throw labels on screen I'm troubleshooting customer apps all the time people are everyday literally you know it calls emails hey can you help me do my Atlas we got a screen shares nine times out of ten the first step in solving their problems I feel labels on the screen to figure out what the data really is versus what they thought it was so anyway we got a label we can see that our combo box is combo box five very nice name thank you very much so we'll do combo box five and then dot and so then up here we've got selected items okay and so selected items is this idea that you can select one or more records so you need to deal with it now the weird thing though is selected items is a record set right think about a drop-down we do select it with a drop-down that's just one single item so we can add that to a text field and things like that here if we do selected items we're gonna do this and so then now we can say alright I want to see the email address and it's like oh that's bad why hover over it it's gonna tell us this property expects text values but this rule produces incompatible table values I'll tell you what I usually do when I first see this grab this data control copy and then we will say Ruth oh a drop-down on the field on the screen and the reason I throw a drop down on screen is because this makes it a little bit easier for me to see what data is in there so you can see I am truly getting an email address and more importantly if we go over here and we choose another one of these and another one of these if we go our drop-down whoop we've got three things in there because we've got three items selected yeah right someone asked me about that earlier today on Twitter like how do I make the drop down or the combo box feed a drop down well Lawrence you can see that there is your answer but that wasn't really what I was after in doing this what I wanted you to understand this combo box five selected email address is a record set so it's not gonna work in a label but Shane I need it in a label right I need to write it somewhere I got you back so we're gonna do is we do a function we've never done before and that is called concatenate text right so that's the concatenate function so when we combine two pieces of text to make you know first space last name and in one label that's concatenate very similarly named is concoct and what can Kat does is that takes a table in this case combo v dot selected and then what it does it says I want to grab all the email address fields out of that table of data and then we're gonna do a comma here and we're gonna say we want to separate those by a comma and a space just like that so calm before by boom boom boom that looks right I'll put a parenthesis there and so then now we could use that data and a label so can cat your record set right and concatenate able we're using it for the first time ever with a combo box but this is one of those ones you want to put in your tool belt for later this is how we combine the text we can see so there's Janet and it's a comma and a space you know it's make this a little bigger right a comma space and then Orlando and then Keith so this was how we were able to work our way through and get that data back if you wanted to use it as text also keep in mind that you know remember over here we're showing oh hold on the Alt key over here we're showing company name and employee but here we're showing email right so we have all of this address Alice information when we could even make it a little fancier right we could say well now I'm getting all scripts I'm probably mess up but I think we've got sales person we do so sales person and right and is there can cat like this and like this I'm nervous but I think that might be right look at that so then now we have adventureworks space janet adventureworks comma so now we've right created a flex set of data back even though the user just chose over here the company name or well they come in a man Pamela but whatever we're able to pull that back so I want to kind of expose you guys that I think that's one of the trickier things about combo boxes for the first time you encounter it is getting data out so just remember that combo boxes selected items is choosing or it's creating a record set so we need to use that king cat function but the nice thing about the fact that gives us a record set is it lets us manipulate the data the way we want all right we have all those columns available to us okay it's another thing they wanted to talk about is so right now the search so hit play let's go up here to get rid of all these go away go away go away so right now if I search for Pamela I'm not gonna get anything especially if I don't start name like alright because it's only searching the company name and when we go over here to this control right this little slide out only gives us ability to search of field that's alright we're pros we're gonna go dig in a little deeper discover here to the property panel annex out of this and so in here let's talk about a couple things first so first you look here here are the items I said that's controlling what items I do right so in a minute we'll talk about how to go a little deeper there but that's pretty normal items were used to that up here we have display fields so this is the syntax that controls what display fields come back so company name and a sales person I'm gonna copy this because if we go over here to search fields oh that's a very similar syntax so what I'm gonna do is I'm just gonna paste in the same exact thing so I now wanted to do searches for a company name or sales persons now is hit play and now oh look at that all the data is already filtered forced so it's only showing us Pamela's records so alright well twist a little effort there and we were able to add different ones also keep in mind that I showed you using the the normal ones here but what if we wanted to do the the email address right let's see if I can remember what it is oh it's not email let's do its email address I'll just copy from here to copy right because it's rude why not telling me Auto suggesting what feels like use so now email address and so what we should be able to do is if I can remember and I think Pamela zero is an email address it's searching it's thinking about it let's select one all right so here's an email address mmm grab an email address let's go put that in here so get rid of a bike store just like that and then we should see everything filter down so there you go there are the two products or that's the two customers where the email address is Orlando zero so pretty cool right because now we're searching on a different feel than the one we're showing probably the last question I would have if I was in your shoes I think well what if I want to have a third field Shane that's a fair question I think it's salesperson like this so it didn't yell at me so what if we get rid of that search I give us all the items back and let's search for Pamela again boom so there you go he even search was only search fields that aren't shown we can search more than the two right or more importantly search more than one that it gave us so a lot of different items of functionality there all right so let's select one all right so another thing I want to talk about so here we talked about getting the data out via selected items in some instances where you're only using it for a single record you could do our friend combo box as an ice ball combo box five dot and see if you start to type their select they kind of hide it from us and then we'll say selected that first name and that's Orlando so we can still use that particular nomenclature and if they select a second record all right looks like it's just the last one in there so can I keep that in mind go back to here so I don't know typically what I would tell you is if you want you can either have to decide I would only want you to use selected items here if you are going to do multi value or multi select right number or a little multi option over here dupe where is it select multiple so selecting multiple is true you're probably using selected items if select multiple is false then you can just use selected so okay so hopefully that helps you understand a little bit how to get the data out um another thing that people can I bring up a little bit here so let's go over here and always select a list like Pamela again or select ones records so I can steal some data someone grab Pamela's username so or a salesperson name anyway what you might want to do though as you might say you know what all right Shane that was great but now I want a filter right so Keith asked me hey how asks me to remind you guys about how to filter data so we go in here and we say no problem I just use a filter so I'm going to say filter sales / that and we'll say salesperson equals paste in Pamela's name boom just like that so then now our fanciful little drop-down only shows the ones where it's Pamela now notice that it reset this is one of the things that makes me are about combo boxes is when we change the data source the items property it said hey I'm gonna just make you start over so it took away all of our fancy settings it was very rude so then now we'll say all right so just company name showing company name and sales person again sorry I reset our search right here it kind of broke things this is one of things that drives people about combo boxes crazy so just get used to the idea that if you're gonna change it on the fly it's gonna reset all your hard work which is okay because you probably need to do it again to kind of reinforce how you did it the first time but just put it in the back of the tinkerer okay but now you can see that my data source is all been sorted out so all the data is just Pamela where Pamela was the sales person so that's how you would filter the data that comes up a little bit I'm on copy this because I'm gonna also wanna show another concept so let's go over here let's get rid of all of this so we're back to just showing the whole list shift-enter and so boom alright there you go okay so we're all back notice that it reset again so rude so show me really want to see the salesperson I really wish you would just keep this salesperson there let's see us make sure that worked yes okay so then now the next thing that comes up is well what about if you want to set the default this drove me bonkers the first time I did it because right when we use our friend the drop-down box over here all you got to do for a defaults item right is you just put in some text of the default item you want and it just figures it out yay that does not work the same over here so what you're going to want to do for default selected items is you need to pass it records okay all right it wants to know what data so you have to kind of correlate the data so whether it's gonna be a lookup to some stuff or a filter and that's why I grabbed this filter oh I messed up this filter nice promise I did this earlier right then my cotton paste did you guys see me mess up and didn't tell me alright so now I am filtering my data so what happens is if we go in here all of the records were Pamela is a salesperson have already been selected for me right because let's back it up with suit again the items property doo-doo-doo-doo is all of the customers lists got it but the default selected items is filter that list where sales person equals Pamela so just keep that in mind remember combo records so I couldn't just type in this right I've tried that I'm like all right let me just grab this piece of data here let's just try and just break it in control copy like alright well I want the default selected to be camp Pamela it's like huh huh it doesn't even have a clue what I mean so you have to work through and make sure that when you're connecting the combo box up to your data that you're passing in records and so filter or lookup or give me one of the two options that you're using and default selected items I mean if you got real fancy you could probably pass at a common list but let's let's just not be fancy let's just look it up got it okay I think that's a lot of what I wanted to cover so I think the other things though we want to talk about real quick is someone asked you know what if I want this to be a people picker all right that's fair control combobox throw it down here and so what I'm gonna do is I'm going to use oh I don't even have the data source right well add the data source or no I do have the data source let's see view data sources yes all right so I added the office 365 users data source okay so what we can do over here is we go in here and say all right I want for you to be office 365 right I don't have to use the wizard it's not let me do what I want I'm gonna use it and I'm going to say office 365 users search user and then I can do what you might want to do is only the top and so many right you maybe don't want to search all of them quite off the bat but what I'm going to do for in the moment is just close this to kind of show you the first iteration all right so then now if I hit this drop-down oh it's showing data that it shouldn't be gonna see or well it's showing a bunch of blank data it's confused all right the city field is empty that's why you're not seeing it let's do um their display name and in the search field should also be the disappointing so alright and when I hit this drop down I'm gonna gray out a couple of these because some of these people haven't consented to their stuff being shown so but if I hit the drop-down so you can see here is it showed me a list of all the users from my office 365 directory and then if I type in like young then it's showing me all the people with the last name young so giving you the ability to go in and you let people choose and so then over here let's just choose me and then we'll exhale jump right and so then what we could do is because you probably didn't want that you probably wanted something like maybe you wanted my email address that's a very common piece of information you would need so then what would this be it be combo box six right we've already done this but you we're gonna just reinforce it and then we're going to selected and then we could do right if we just had the one then we could definitely do not mail nickname mail there we go so there's my email address but remember that's all I'm gonna show the one so what you probably more correct we want to do was to do the old can cat combo box selected combo box selected and then comma mail oh and it's not selected though it's selected items and so that'll pull it out even in case where it's just the one item but more importantly as if we go back over here and we choose two records right then now we're able to pull it out then we could do the formatting and all that fun stuff so that's uh you know kind of getting started with the people stuff if you use a person list or person field over in SharePoint that's a little bit difference we're going to save that one for the the SharePoint one and then this is a quick bonus because the team released this stuff and I haven't covered it yet also remember that if people search is kind of those things that's driving you right hit new screen remember there is a people search screen template they've given us now so hit new at that screen and so if I do a search here Alissa's hit play OH my name is Shane so there you go so I want to select that particular user it's alright including the the stuff so no there's Chui and so we're able to go through and select that way the reason I show that to you is because I want you to if that's one of the reasons you're looking at combo boxes I think these guys did a neat job here now while you might not take this screen and use it because it doesn't fit the flow of your app what you can do is come in and reverse engineer the way they did this they actually did a bunch of different so there's a couple of different galleries over here so they didn't use a combo box at all but it's a different way to look at kind of same pramukh I know people search is one of the things that drives to the combo box all right so I think that was all the fun things that I wanted to talk about I'm certain I will come up with more but there'll be a follow-on video just for SharePoint specific stuff also if you have questions right I get about 10 a day literally every single day I get somewhere between 10 and 15 between comments and Twitter's and emails so leave comments below with your questions that's what drives these type of videos and things like that so also if you're still kind of a little wrong with power out remember make sure you check out power apps nine-one-one we can work together we've also got a training class now I'm teaching it all Monday through Thursday this week I'm really excited for it so it should be fun but I think that's enough for today so thanks and have a great day hey it's me again if you got a second click the subscribe button that always keeps me making more videos or if you want to work together need some help getting your power apps going hit me up with power apps nine-one-one always happy to work together or finally if you're always looking for more videos that's probably what it is check out the power ops playlist over here and you know enjoy that alright thanks and have a great day
Info
Channel: Shane Young
Views: 127,582
Rating: 4.9022007 out of 5
Keywords: Shane Young, Bold Zebras, powerapps combobox, powerapps combobox search fields, powerapps combobox search, powerapps combobox example, powerapps combobox filter, powerapps combobox items, powerapps combobox selected value, powerapps combobox datasource, powerapps combobox set default value, shane young powerapps, powerapps911, power apps, powerapps combo box, powerapps combobox control, selecteditem, defaultitems, powerapps people search, learn powerapps, powerapp combo box
Id: pjs0ZsnJZXo
Channel Id: undefined
Length: 25min 50sec (1550 seconds)
Published: Sun Nov 11 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.