PowerApps set default value based on another field from a dropdown

Ғылым және технология

Sometimes you want to set the default value of a field, a group of fields, or a form control based off the selected record from a dropdown. In this video you will learn exactly that. You will create a dropdown and when your user selects a record you will then populate a text input, a different dropdown, a combo box, a collection, and even a people picker. This video has come from the common question of how do I set default values based on a dropdown that have come from many viewers. We also answer two related questions from Twitter and customize a form. The primary data sources shown are SharePoint and Office 365 Users but everything should be applicable to other data sources like SQL and Dataverse.
00:00 Start
01:34 Demo of the problems we solve with dropdowns
04:01 Using a dropdown to set the default values of a text input, drop down, and a label
09:37 Setup a gallery, a form, unlock some cards, and populate fields based on data from a different table data source
17:19 Look at how to set a combo box from the selection in a dropdown control used for a people picker and Office365Users.SearchUserv2
19:09 Use the chosen record in a Power Apps Dropdown to populate a collection by filter another data source thanks to OnChange property
Power Apps Consulting and training at www.PowerApps911.com

Пікірлер: 91

  • @cmacdhon
    @cmacdhon2 жыл бұрын

    Shane, I was thinking... You are essentially doing my job for me. I'm really just a guy who watches your videos, and clicks his mouse all day. I should send you a W-9 to fill out. I cannot express my gratitude enough for all that you do. My boss would too, if he only knew.

  • @wendymeyer1250
    @wendymeyer125017 күн бұрын

    Can't even find the words to express how immensely grateful I am for your videos! 🙌

  • @JennyJenn831
    @JennyJenn8312 жыл бұрын

    Thank you for being you and bringing serenity to my workday. :) Another wasted 2 hours spent PRIOR to just coming to one of your videos and learning how to do something in less than 3 minutes! Who's better than you?!? NOBODY!

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    Wow, thank you Jennifer! 🐶

  • @MesVser
    @MesVser Жыл бұрын

    Shane you are an amazing resource! I spent hours trying to figure out how to have an Edit form field autofill based on another field in the form. 5 minutes of watching this video and Edit form is now working as expected.

  • @marieferguson3578
    @marieferguson35782 жыл бұрын

    Thanks Shane! Really appreciate the response and the walkthrough for the people picker field!

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    You are welcome! 😍

  • @TechieManufacturer
    @TechieManufacturer Жыл бұрын

    For days i struggle with how to do this, now your video just made me cross the hurdle with this project, thank you so much

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Awesome!

  • @_achilles__
    @_achilles__ Жыл бұрын

    Thanks Shane. Stuck with this Issue for a long time until I watched your Video! Your videos really help me a lot.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Awesome 😎

  • @edinbrgt64
    @edinbrgt642 жыл бұрын

    Hi Shane I really like your material and the way you teach, sincerely thanks, I am so happy learning with your videos, I was able to perfom a portal and most of my queries found an answer within your videos. Thanks a lot once again.

  • @jamesbuchanan407
    @jamesbuchanan407 Жыл бұрын

    Got what I needed in the first 5 minutes. Thanks.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Perfect! Glad it worked for you.

  • @andymcvicker1948
    @andymcvicker1948 Жыл бұрын

    Hi Shane, I love your videos. They're really helpful!! One question on this one. If I wanted to change the person in the in the People picker field, how would I write that back to the record?

  • @peterscheepers5780
    @peterscheepers5780 Жыл бұрын

    Hi Shane, thanks again for a great and very useful video that I revisited today. You got me halfway to the solution of my problem. In my case I am replacing an Access database frontend with SharePoint lists as the backend that has a large number of related tables. As it is a properly designed database (I made it myself😉) it uses unique auto increment key fields to define the references. So instead of writing the Title fields back from the drop-downs. I need to write back the reference key values. However when doing that the key value disappeared when saving the record. It is no-use making the drop-down show the key values as the user cannot relate to these. I solved the problem by patching the key value back based on the on-change property of the dropdown back to the key field and overlayed the dropdown with a text field looking up the Title based on the key value. I hope this makes some sense to you and maybe there is a better way of doing this, but I thought that there may be other people having the same problem as there are still a lot of Access databases out there. As for me MS Acces and VBA are still more comfortable I sometimes struggle with the PowerApps although with the help of your video’s I have already made some 15 PowerApps based on the MS Access data.

  • @steegbj
    @steegbj2 жыл бұрын

    Thanks for answering my question, Shane. Not sure if that is exactly what I meant, but on the upside, I've got a collection named after me! :-)

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    Bummer. What were you looking for exactly?

  • @steegbj

    @steegbj

    2 жыл бұрын

    ​@@ShanesCows Sorry Shane, I didn't manage to describe the entire use case in a tweet. :-) What I'm aiming at achieving is this: When a user presses a button, a Patch command updates the status of a number of items in a SharePoint library (Library A). At the same time, I need to patch one or more items in SharePoint list (List B), where Column C in Library A equals Column G in the List B. The information to update column Z in the list with comes from a dropdown (dropdown.selected.value).

  • @FSLRFP
    @FSLRFP Жыл бұрын

    Hi Shane. Great video tutorials. Learned a lot!!! Question - I have three galleries (Categories, Topics, and SubTopics) all pointing to their associated tables. There is a key on each so I can filter accordingly. Once I select a Category row, I want the first item to be automatically selected from the Topics gallery which then automatically filters out the SubTopics gallery. Unfortunately, I can't seem to get this cascading gallery model to work. Although I can highlight the first item in the second gallery, I can't seem to invoke the 'on select' command. Thoughts?

  • @kellyliu4225
    @kellyliu4225 Жыл бұрын

    Great video examples thank you! Hope you can do the similar video with custom page(Canvas style) for Model-Driven, particular dropdown that not come with Insert Input box.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Thanks Kelly. I haven't done that before so not sure I have an answer on that one. 🤔

  • @mikegc3816
    @mikegc38162 жыл бұрын

    Hi Shane, how do you do it the other way? I have a combo dropdown that looks up an Office365 user and depending on the country that the user is from, I want to set the Currency drop down to the correct currency. The drop down is just prepopulate with a table ({ Text: "Euro", Val: 1}, { Text: "US Dollar", Val: 2} etc:. I have tried a few things, but its got me stumped. Cheers Mike

  • @FrankSzalai
    @FrankSzalai Жыл бұрын

    Thanks!

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Appreciate the support Frank. 🙂

  • @Parwitch69
    @Parwitch692 жыл бұрын

    I did link dropdown to dropdown like you demonstrate but there is an error. It said "the property of this control expects Record values. The rule produces Text values which are incompatible"

  • @georgiayouthchallengeprogr237
    @georgiayouthchallengeprogr237 Жыл бұрын

    Hey Shane, nice demo. I'm new to SP and Power Apps, Forms, and Lists, all things Sharepoint. I'm looking for a way to connect a prospect's form entry of County to a territory representative. Georgia has 159 counties and we have divided the state into six territories. So when a new prospect submits our initial interest form, they enter their state(typically Georgia) and their county both in separate drop-down lists, along with their name, phone number, email address, etc. How can I create the SP Flow to send an email to the prospect with information that includes the territory representative's contact information and an email to the territory representative with information on the prospect using Flow effectively. I look forward to your positive response.

  • @TessAlmond
    @TessAlmond Жыл бұрын

    I've tried and tried and this isn't working for me. I think the Distinct on the 2 dropdowns, doesn't allow the 3rd field (text label) to see the 3rd value. I have a lookup table with 3 columns, Office, System and Approvers. On the form I have have dropdowns for the Office and System field with Items set to Distinct(SystemLkp, Office) and Distinct(SystemLkp, System) and a text label that i want populated with Approvers based on both dropdown selections. I tried a lookup and failed.

  • @PowerAppsTutorial
    @PowerAppsTutorial2 жыл бұрын

    I like it Shane! ...but based on that animated gif from your twitter, I was expecting a RPG quest! 😁

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    Darn it, must do a better job in the future. 🐶

  • @tnd78
    @tnd78 Жыл бұрын

    Great Videos. Quick Question: I have a parent and child list. When someone clicks button from parent list, the ID is captured via variable. I was successfully able to show that parent ID in child parentid lookup column but for some reason when I hit submit (this is a new form), the parentID i captured doesn't save with form. Any suggestions greatly appreciated.

  • @kumnegerholdings
    @kumnegerholdings9 ай бұрын

    Thank you Shane. Question, I have a dropdown that is a choices field from SharePoint. Based on the value selected from the dropdown, want to default a "Assign to " column (person data type). I have a lookup table where choices are mapped to names. How do I go about this? TIA

  • @MarcosRodriguez-gm7sk
    @MarcosRodriguez-gm7sk2 жыл бұрын

    I admire your energy and enjoy your videos! Is there a way to cascade or filter dropdowns with hard code items?

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    Did you try this video? kzread.info/dash/bejne/hX-B2cOylsLJpbA.html

  • @DR-1989
    @DR-1989 Жыл бұрын

    Is there a way to have certain form fields pre-populate based on the last form submission by a user? I have a training form that requires the trainer, trainee, date, job, & job area Of these fields I would like the job area to be auto populated (I already figured out how to do the trainer (he is the one entering info) and the date to pre-populate based on the today() feature. let me know if this makes sense

  • @JohnJoe131
    @JohnJoe1316 ай бұрын

    for me when I submit a form all the values from the combobbox disappear and save blanks into the sharepoint. I think it's because the .selected loses focus and returns blanks but idk how this happens only for me

  • @JoeMcCarthy-x4r
    @JoeMcCarthy-x4rАй бұрын

    Hi Shane, Your videos have been awesome. I have a dropdown for a SP lookup column that I need to convert to a text field so I can create charts. I created a text field in SP and made the default the dropdown,selected.value which does populate the dropdown value, however when I submit the form it returns an error (not specified). The Microsoft forums are coming up empty. Do yo have any suggestions. TIA for any help!

  • @NikeshMistry98
    @NikeshMistry98Ай бұрын

    Trying to update the text box value to a value in a SharePoint list but it isn't picking up the column I want to update the textbox to based on the drop down list option. Any ideas?

  • @FatimahMohammed
    @FatimahMohammed2 жыл бұрын

    Hi Shane another great video! I have a question. What is the best way to add an option to a dropdown. If my dropdown values are set to a lookup, but the default value doesn't exist in that lookup, I want to add it to the dropdown. I'm just going to create a collection and add it, but I was wondering if there is a better way to do this. Thank you!

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    That is the easiest way. :)

  • @KingShort8
    @KingShort87 ай бұрын

    If I want to select more columns from my sharepoint list like: Name, Address, Zipcode to display it in the Text field based on the Dropdown. How can I do that?

  • @mardithpascua8112
    @mardithpascua81122 жыл бұрын

    Hey Shane, just wondering if there's a way to put at least 2 person name in DefaultSelectedItems in a combobox (person field)? right now, i can only put 1 default value using the 365OfficeSearchUser.

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    It is all about getting the data exactly the way the control wants. I go into a lot of detail in this video. kzread.info/dash/bejne/c4x1xM-yad2_hLg.html

  • @mikedsjr
    @mikedsjr10 ай бұрын

    Man, thanks a million. Im curious, how do you order the dropdown list? I was trying to figure out this exact thing you showed in this video.

  • @ShanesCows

    @ShanesCows

    10 ай бұрын

    SortByColumns - kzread.info/dash/bejne/kYJ3rseLoNLaY84.html

  • @kabax5
    @kabax5 Жыл бұрын

    Do you know how a choice field can set a default value based on two other choice fields? Field 1 has choices A or B. Field 2 has choices C or D. Field 3 has choices W, X, Y, Z. I want Field 3 to equal W if A+1, X if A+2, Y if B+1, and Z if B+2.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    You would use that same If logic in the Default property of your dropdown. :) Solve it one baby step at a time and it shouldn't be too hard. :)

  • @cbtjoe
    @cbtjoe2 жыл бұрын

    Is there a slight adjustment I can do for a combobox or is it not possible? On DefaultSelectedItems i have: If(frmForm1.ModeFormMode.New, LookUp(colStaffName, VendorName=Parent.Default),Parent.Default) but I get an error with the IF statement expecting a Record.

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    I think for the false portion you just want nothing. If(frmForm1.ModeFormMode.New, LookUp(colStaffName, VendorName=Parent.Default)) is my guess for your right answer.

  • @LylyMing79
    @LylyMing794 ай бұрын

    4:25 - I'm not able to see the field I'm looking for. Do you have any idea why? Thanks.

  • @johanynavarro8065
    @johanynavarro80652 жыл бұрын

    Hey Shane!! great video, I've seen on social networks that many people need to set the default value within a form based on a combo box outside the from, Is that possible legend?

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    Yes. Same exact steps as I showed in this video. 😊 The dropdown I had in the form could have been outside of the form, which wouldn't have changed the logic. And the Dropdown could have been a combo box. :)

  • @KenJagers
    @KenJagers Жыл бұрын

    Hey Shane, I'm having trouble replicating this when my datasource is a sharepoint list. Specifically at this point- kzread.info/dash/bejne/Y4VsrpSBaMbWddI.html, it wont let me specify the column! The error it returns is "Name isn't valid (Column Name) isn't recognize." Is there a different way to do this using a List as a datasource? Edit: I figured out my problem. Lists do work absolutely normally, my issue was I was feeding my list through the "Distincts" function. Distincts returns a table of only the distinct entries from the specified column of the datasource, it meant my dropdown was not populating an entire record- it was populating a single entry from a single column generated from the list.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Glad you got it. Thanks for sharing. 😀

  • @Daviirose3
    @Daviirose32 жыл бұрын

    Shane, can you do a video on model driven app

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    That is absolutely in my plans for sooner than later. I need to get better at them so what better way than showing you. Probably going to be January before I get it done though. I do have a plan, as it will take a few videos to get it all in.

  • @NOR3MSTI
    @NOR3MSTI2 жыл бұрын

    What about only printing certain div's in the html document based on selections inside the app, for instance, instead of printing the entire form, only print questions in the form that have certain properties selected ,, radio button or drop down etc. thanks for the vids.

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    I have done similar before, Just have to write a lot of If statements in your HTML.

  • @stephl4843
    @stephl48432 жыл бұрын

    Shane, first time caller....long time fan... ;-) Question: Have you ever thought of doing a video that does: **Pulls information for drop down fields from an external source, **Where a VPN login is needed to keep the field options up to date? (not a LDAP source but does have an API available with the date)

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    I haven't. But if you can get a list from the API then this video might give you some ideas of how I query an api and send it back to Power Apps. kzread.info/dash/bejne/pIaixMdqc8m3Y5M.html

  • @stephl4843

    @stephl4843

    2 жыл бұрын

    @@ShanesCows - My scenerio: In my list (for training requests) I want my form to pull the users name from LDAP (which I can do) and in 3 fields, I want the field options to be based on my API data. That API Data does update often and I don't want to manually update those options in the field, every day. To get the API data, I have to be on a VPN. I can't find a way in Excel to have it record a macro to log into the VPN before it updates the data in excel also.

  • @garimatewari2212
    @garimatewari22122 жыл бұрын

    Hi Shane, could you please share some help with model driven apps as well.

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    It is on my list for 2022. :) Looking forward to finally adding them.

  • @mikewashington4188
    @mikewashington41882 жыл бұрын

    Hi, is there a method in SharePoint to trigger an event based on a value in a field? For example when my drivers license expires so I would get an email and text message sent to me a couple of weeks reminding me. Thanks

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    I would adapt this concept. kzread.info/dash/bejne/o3ul07Ojd7Dbnps.html Have a flow that runs once a day to get items that meet your criteria for notification. :)

  • @mikewashington4188

    @mikewashington4188

    2 жыл бұрын

    @@ShanesCows - Thanks a bunch. This will definitely solve my problem.

  • @koppelekoppelek8758
    @koppelekoppelek87582 жыл бұрын

    Hi Shane, do you have the app in the resource library? i cannot seem to find it

  • @koppelekoppelek8758

    @koppelekoppelek8758

    2 жыл бұрын

    found it never mind sorry 12/7/2021 - Power Apps set field values based off a Dropdown's selected record

  • @ShanesCows

    @ShanesCows

    2 жыл бұрын

    Glad you found it. 😎

  • @jl1399
    @jl1399 Жыл бұрын

    How would you do this from SharePoint integration in powerapps?

  • @jl1399

    @jl1399

    Жыл бұрын

    If(DataCardValue59.Selected.Value "UNITED STATES",Set(defaultComboValue, LookUp(Choices('Awards'.DataCardValue62), Value="Yes"))) put on the Default column of Datacard 62 to change its value to Yes if anything but United States is selected

  • @bhagidasari9051
    @bhagidasari9051 Жыл бұрын

    How can I achieve the same in Model Driven app ?

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    I am not sure. Sorry.

  • @Andyandrwew144
    @Andyandrwew1442 жыл бұрын

    I love the drop down but I always go for a combo box.

  • @ksowjanya4488
    @ksowjanya4488 Жыл бұрын

    what if department dropdown is result not department value. how to represent other text input values?

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    It is Result most likely because you used Distinct. With Distinct there are no other fields available. You would have to LookUp the rest of the data if you needed it.

  • @NikeshMistry98

    @NikeshMistry98

    Ай бұрын

    @@ShanesCows How can this be achieved ?

  • @prelovedsorted
    @prelovedsorted3 ай бұрын

    Have you made any videos regarding the gallery under gallery controlled by dropdowns? if yes please locate me. your videos are really very helpful and I also want to know about the short courses if your group offer I would love to join Thanks for your Support

  • @ShanesCows

    @ShanesCows

    3 ай бұрын

    This video might help? kzread.info/dash/bejne/c6p7tM6rpbC8nqw.html All of my training classes are at training.powerapps911.com

  • @aadi2388
    @aadi23884 ай бұрын

    how do i use this on a combo box?

  • @ShanesCows

    @ShanesCows

    4 ай бұрын

    Check out this video for ComboBoxes kzread.info/dash/bejne/c4x1xM-yad2_hLg.html

  • @aadi2388

    @aadi2388

    4 ай бұрын

    @@ShanesCows thank you so much

  • @dandrem.4074
    @dandrem.4074 Жыл бұрын

    I swear all his videos are so confusing. Nothing in my Powerapps has ever worked how he gets his to work. I create a dropdown and literally NONE of my dropdowns in my Sharepoint populate to connect to the dropdown display. Only text...that defeats the purpose of a dropdown/choice column. So, in order to do this I have to create a random text field with the values I want to populate in a dropdown list. Which makes no sense.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    For your Dropdown you should set the Items property to Choices(ListName.ColumnName) then it will show you the Value property which is the text of all of your Choices from the column. In my example data I use Choices(Employees.FavoriteColor) Because Employees is my list name and FavoriteColor is my column name. Then I see Red, Blue, etc in the list of dropdown options.

  • @dandrem.4074

    @dandrem.4074

    Жыл бұрын

    @@ShanesCows I'm talking about setting the Value for the initial DropDown. The DropDown Columns do not populate under the Value Menu.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    @@dandrem.4074 I don't understand. Feel free to shoot me an email shane at powerapps911.com with some screenshots and I will see what I can do.

  • @muzammil4589
    @muzammil4589 Жыл бұрын

    How to set a label based on a drop-down and text field

  • @wilapblkhistory8310
    @wilapblkhistory8310 Жыл бұрын

    You’re awesome… do you have a mic on near your throat, every time you swallow I lose it.

  • @davidrico8755
    @davidrico87552 жыл бұрын

    Hi Shane, im new to your channel and am loving the content. Would you have anything on chnaging the font color based on values. I put this formula in to chnage the color based on how many days its have passed. Butr i get an eror that says scope not supported. My formula looks like this. If(ThisItem.'ARRIVAL DATE.'=Today()-2,RGBA(44,210,47,1),ThisItem.'ARRIVAL DATE.'=Today()-4,RGBA(232,225,27,1),ThisItem.'ARRIVAL DATE.'>Today()-5,RGBA(249,132,31,1))

Келесі