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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding a value to a co...
Power Apps
Unanswered

Adding a value to a combo box that already has values

(0) ShareShare
ReportReport
Posted on by 32

I would like to have a button that when selected would send a value to a combo box in my form that already has values in it. When I attempt this it simply removes the values and replaces it.

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

    Set the Items property of the combo box to a collection. Then, add the new item to the collection.

  • FernandB1 Profile Picture
    32 on at

    Will this retain the items currently selected in the combo box?

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @FernandB1 ,

    Please supply (in Text) the Items and DefaultSelectedItems of the Combo Box, the Update of the Data Card it is in and the Names of the List and Field you are writing to.

  • FernandB1 Profile Picture
    32 on at

    Hi Warren,

    Items: 
    Choices([@'STARS Screening Form'].Today_x002c_Iamreportingon_x0028)

    DefaultSelectedItems:
    Parent.Default

    Update:
    Reporting.SelectedItems

    List Name:
    STARS Screening Form

    Form name:
    Form2

    Thank you!


  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @FernandB1 ,

    Using your Values

    Items - OK if this is a Choice column

    Choices([@'STARS Screening Form'].Today_x002c_Iamreportingon_x0028)

    DefaultSelectedItems:

    ThisItem.Today_x002c_Iamreportingon_x0028

    Update - should be OK

    Reporting.SelectedItems

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • FernandB1 Profile Picture
    32 on at

    What would the OnSelect property of the button be in order for me to pass the value to the combo box?

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @FernandB1 ,

    Sorry - missed that part on the button - go back to @sopatte 's response - you need to collection.

  • SoPatt Profile Picture
    Microsoft Employee on at

    OnVisible of your screen (or wherever it's convenient to initialize this collection):

    Collect(ComboItems,Choices([@'STARS Screening Form'].Today_x002c_Iamreportingon_x0028))

    Items 

    ComboItems

    Button's OnSelect

    Patch(ComboItems,
     Defaults(ComboItems),
     {YourComboDisplayField: TheValueYouWantToAdd}
    )

    I think something like that will work. I haven't tried it.

  • FernandB1 Profile Picture
    32 on at

    Thank you sopatte,

    The patch does not seem to be working. The value does not appear in the combobox.

  • SoPatt Profile Picture
    Microsoft Employee on at

    What's your ComboBox's Items property set to?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard