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 Platform Community / Forums / Power Apps / Set Default of ComboBo...
Power Apps
Answered

Set Default of ComboBox According to Text Input

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a combobox with about 75 different choices. I would like the DSI of this combobox to be equivalent to a text input control value, if one exists. Is there an efficient way to do this without 75 different IF statements in the DSI? e..g.:

 

If(
 Field.Text = "MyChoice",
 LookUp(
 Choices([@'Test_1'].'Options.Choices'),
 Value = "MyChoice"
 ),
Categories:
  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Here you go:

     

     

     

    LookUp(ComboBoxSample,Value1 = TextInput1.Text)

     

     

     

    Please see the following example.  The key is to use the "DefaultSelectedItems" property

    Rusk_0-1675724415227.png

    Typing "Item 1", "Item 2", etc. in the text input will change the dropdown value.  In this example the source table for my ComboBox is named "ComboBoxSample" and the column I'm matching to is named "Value1"

     

  • shuhn1229 Profile Picture
    on at

    Hi - 

     

    Thanks. What is the items property on your ComboBox? Cant get it to work as above. My combobox's items are set to distinct of a column for what its worth. Thanks.

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    My ComboBox Items is "ComboBoxSample".  That's the default placeholder table the control has.  In your case, it should be 

    LookUp(YourDataSource,YourColumn = TextInput1.Text)

     

    Your data source is the table your combo box is referencing, the column is the same column you're using in your combo box (first value, the value you are matching to)

  • shuhn1229 Profile Picture
    on at

    Hi,

     

    I'm sorry I'm completely confused now.

     

    The DSI or Default selected items in your combobox control is:

    LookUp(YourDataSource,YourColumn = TextInput1.Text)

    You're saying that the items property on the combobox control is the same as above? I've tried both and neither work. Is your value1 column a text column or other type on sharepoint? Apologies ahead of time, trying to troubleshoot.

     

    My Items is set to the following right now, which works to display the choices, but does not default to anything when something is typed in the textinput control. For what its worth my "YourColumn" is text.

    RenameColumns(
     Distinct(
     dbName,
     someId
     ),
     "Result",
     "someId"
    )

     

  • Verified answer
    Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Here's another example.  I simply gathered a few items into a collection named colTest, text values only:

    Rusk_0-1675728658788.png

    Then I added a Combo Box.  The "Items" is set to colTest:

    Rusk_1-1675728742189.png

    Lastly, I added a text input.  Using the formula above, the new formula for my combo box "DefaultSelectedItems" is

    LookUp(colTest,Item = TextInput1.Text)
  • shuhn1229 Profile Picture
    on at

    Thank you for all of your help. I got this to work by generating a collection on start using the distinct function

     

    ClearCollect(
     colID2,
     Distinct(
     'User Notification Controls',
     Title
     ).Result
    );

     

     

    and then using the following on DSI:

     

     

     

    LookUp(colID2,Result = TextInput1.Text)

     

     

    Combobox items set to colID2

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard