web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Set Combobox Value

(0) ShareShare
ReportReport
Posted on by 764

This should be simple.  I have a combobox (ClientContactCB) with a list of names.  One name is Ted Bell.  I have a variable, varClientContact = "Ted Bell".  I want to set the value of the combobox to the value of the variable "Ted Bell".

Categories:
I have the same question (0)
  • dinusc Profile Picture
    Microsoft Employee on at

    Hello mogulman,

    What do you mean by "set the value fo the combobox"? Do you mean:

    1. Changing the value of one of the ComboBox items?

    2. Selecting that item in ComboBox?

     

    For #1, you would have to change tha value on the source (form which the ComboBox is getting data)

    For #2 For example:

    Button1.OnSelect=Reset(ClientContactCB);Set(d, [varClientContact ])

    ClientContactCB.DefaultSelectedItems=d

     

    Clicking on Button1 should select the item from the variable varClientContact

  • mogulman52 Profile Picture
    41 on at

    I guess I'm not explaining myself very well. But I finally figured out problem.  DefaultSelectedItems expects a table.  Simply put square brackets around it to cast as table [varClientContact].  After I figured it out I looked dinusc's solution and noticed square brackets.  Wasted 2 hours on this.

     

    Cast2Table.png

     

     

  • dinusc Profile Picture
    Microsoft Employee on at

    I'm glad you figured it out. Please note that the reason you need square brackets is because the DefaultSelectedItems can have more that one item.

  • NPrice99 Profile Picture
    1,302 on at

    Hi

     

    How do I set the DefaultSelectedItems to the item the user has selected from the drop down ?

     

    Regards

     

    Nigel

  • NPrice99 Profile Picture
    1,302 on at

    Hi

     

    I have tried this abd I get an error for combobox.DefaultSelectedItems saying that DefaultSlectedItems is an invalid name !

     

    Anybody Any ideas ?

     

    Regards

     

    Nigel

  • mogulman Profile Picture
    764 on at

    How do I set the DefaultSelectedItems to the item the user has selected from the drop down ?

     

     I'm not understanding your question.  Do you have Dropdown and a Combobox?

     

    To get value of Combobox selection use this:

     

    Last(ClientContactCB.SelectedItems).FullName

    ClientContactCB is the combobox.  FullName is the field in the combobox.  If this is not what you want post specific details on your question.

     

     

     

     

  • NPrice99 Profile Picture
    1,302 on at

    Hi Mogulman

     

    I am trying to set a value for a combobox when a user selects a item from the dropdown.

     

    Thanks

     

    Nigel

  • dinusc Profile Picture
    Microsoft Employee on at

    Hello Nigel,

     

    The following should work for default ComboBox1 and DropDown1 controls:

    DropDown1.OnSelect=Reset(ComboBox1);Set(dsi,Dropdown1.Selected.Value)

    ComboBox1.DefaultSelectedItems=[dsi]

  • NPrice99 Profile Picture
    1,302 on at

    Hi dinusc

     

    This almost worked !

     

    The selected value flashes up for a moment before "Find Items" overwrites it.

     

    Regards

     

    Nigel

  • dinusc Profile Picture
    Microsoft Employee on at

    There should be another formula that overwrites it then. Please test this with a blank app with default DropDown and ComboBox controls. Selection should work and this should be a good starting point to check other formulas in your "real" application. My guess is that there's somewhere another "Reset(ComboBox1) formula that removes the selection.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard