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 / How do I set a combobo...
Power Apps
Unanswered

How do I set a combobox with button that submits a value from a text field to the combo box

(0) ShareShare
ReportReport
Posted on by 634

Here is what I have.

 

  1. Combobox with list of products including a single item called "Add Product"
  2. A text box and button that appears if you select " Add Product"
  3. When you add a new product to the text box and click the button the entered value is added to the combobox, via a patch to the datasource, and the combobox is refreshed.

 

Here is what I want:

  1. When the button is clicked and the new value added to the datasource(combobox) I would like that new value to be selected when the combobox is refreshed.

Can this be done? I imagine it can. As an added bonus I'd probably want to hide the textbox and button when the button is clicked but I think that might be trivial assuming that the submission always works.

Categories:
I have the same question (0)
  • GarethPrisk Profile Picture
    2,828 on at

    Presumably the data source is Dataverse, or SharePoint.

    You can:

    1. Use a context variable to collect the value you are creating
    2. Patch the data source to create the value
    3. Reset the Combo Box (maybe, it can work without the Reset())

    The Combo Box's Default value would be the variable, which will help it to set it as the default value. Another tricky thing with Combo Boxes is that they can have single or multiple values. This will work for single values, but will require some additional considerations to work for multiple values.

    UpdateContext(
     {
     locSelectedValue: Patch(
     dataSourceName,
     Defaults(dataSourceName),
     {column: value}
     )
     }
    )
  • Future_Vision Profile Picture
    634 on at

    I'm building the app in Teams and just selecting the "Create new table" option. Is that CDS or Dataverse?

     

    Where would I be setting the context variable. At the OnSelect of the button? Currently, I only have a Patch function that writes the value to the datasource.

  • Verified answer
    Future_Vision Profile Picture
    634 on at

    Figured it out. I updated the button like this which seems to work

    UpdateContext(
     {
     newThird : Patch(
     'Third Parties',
     {'Third Party (cr9c7_thirdparty)':'Add 3rd Party TB'.Value}
     )
     }
    )

     

    Then set the DefaultSelectedItems to newThird

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard