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 / Add User Input to Comb...
Power Apps
Answered

Add User Input to Combobox Choices

(0) ShareShare
ReportReport
Posted on by 16

Hi

 

I am customizing my sharepoint list form. One of the columns is used to enter designators of electronic parts, so I need multi-selection available and I want the users to be able to add new entries that also show up for future uses.

 

No matter what I try, I get errors about wrong data types or it just does not save the new entry.

 

I saw a GIF of it working with a + symbol here and this is basically exactly the function I am trying to achieve. Is there a beginner-friendly tutorial out there?

 

Thanks.

Categories:
I have the same question (0)
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    To add user input to a ComboBox control in Power Apps and allow the users to add new entries, you can follow these steps:

    1. Add a ComboBox control to your Power Apps form. Select the ComboBox control and go to the "Properties" pane on the right.

    2. In the "Items" property of the ComboBox, specify the data source that contains the existing designators of electronic parts. For example, if you have a SharePoint list as the data source, you can set the "Items" property to something like `SharePointListName.ColumnName`.

    3. Enable the "Allow searching" property of the ComboBox. This allows users to search for existing items in the ComboBox.

    4. Enable the "Allow multiple selections" property of the ComboBox. This allows users to select multiple items from the ComboBox.

    5. Set the "Update" property of the ComboBox to a collection that will store the selected items. For example, you can create a collection using the `ClearCollect` function:
    ```

    ClearCollect(SelectedItems, ComboBox.SelectedItems)


    ```
    This will store the selected items in the "SelectedItems" collection.

    6. To allow users to add new entries, you can use an additional text input control and a button. Add a text input control where users can enter new designators and a button to save the new entry.

    7. On the button's "OnSelect" property, add the following formula to add the new entry to the ComboBox choices:
    ```

    Collect(ComboBox.Items, {Value: NewEntryTextInput.Text})


    ```

    This formula uses the `Collect` function to add a new entry to the ComboBox's data source. Replace `NewEntryTextInput` with the name of your text input control.

    8. Save and test your Power App to see the changes in action. Users should be able to select existing designators from the ComboBox or enter new ones using the text input and button.

    As for beginner-friendly tutorials, the Microsoft Power Apps documentation provides a comprehensive resource for learning and exploring various features. You can refer to the official documentation for ComboBox controls and explore related topics. 

  • developerAJ Profile Picture
    4,664 on at

    @dbx 

     

    Please provide datasample for the combobox you are using along with the formula

  • dbx Profile Picture
    16 on at

    Hi

     

    Thanks for your detailed explanation. I tried doing exactly as you described but it won't work.

     

    1. The ComboBox is inside a DataCard, does that matter?
    2. My Combobox does not have an Update property, just a OnChange Property, should I use the OnChange Property?
    3. For the collect action on the button, I cannot select .Items from my Combobox, only SelectedItems. Is the reason because my items are coming from the sharepoint list? (Choices([@'Erfassung fehlerhafter Teile'].Designators)

     

     

  • developerAJ Profile Picture
    4,664 on at

    @dbx 

     

    Try this out 

    If(IsBlank( DataCardValue7.Selected.Value),{Value:DataCardValue7.SearchText}, DataCardValue7.Selected)

     

    this formula you need to use on your datacard update property. 

    what it does is if user search is not available than it will add the value that they entered into sharepoint

     

    Please click Accept as solution and Thumbs Up. 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.

     

     

  • dbx Profile Picture
    16 on at

    This seems to work so I can use the search Text as an Input but I need to be able to use multiple values and be able to mix existing choices with new choices, I think I need to use the text-field and "add"-Button Approach @ShaheerAhmad described. 

  • developerAJ Profile Picture
    4,664 on at

    @dbx 

     

    if its multiselection 

     

    Add button onselect: Collect(colSelectedItems,{Value:DataCardValue7.SearchText});Reset(DataCardValue7)

     

    DataCardValue7  onselect: ClearCollect(colSelectedItems,DataCardValue7.SelectedItems)

    DataCardValue7 defaultselecteditems: colSelectedItems

     

    Please click Accept as solution and Thumbs Up. 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.

  • dbx Profile Picture
    16 on at

    @developerAJ Thanks for helping me. I kind of got it working (can add new items via text field) but the only problem still not solved is that when i open an entry with already existing values in the designator choice field, it will not load and display these but it will either have a blank collection (if I reloaded the page) or carry over the values from the previous entry.

     

    I guess I have to tell it somehow to clear the collection and then to check for existing values in sharepoint and add these to the collection everytime an entry is opened?

  • Verified answer
    developerAJ Profile Picture
    4,664 on at

    @dbx 

     

    On both screen new form and Exisitng form.

    Clear the Collection.

     

    When it comes to existing form on visible of screen set(varFormcomboChanged,false);

    combobox on select property and addbutton on select property set(varFormcomboChanged,true);

     

    combobox defaultselected items use if(varformcombochanged,colSelectedItems,Parent.Default)

     

    Please click Accept as solution and Thumbs Up. 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.

  • dbx Profile Picture
    16 on at

    That seems to work like a charm. Thank you.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard