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 / Patching a Combobox (w...
Power Apps
Answered

Patching a Combobox (with multiple selections + option typed in by user) to a Sharepoint list column with the same features

(0) ShareShare
ReportReport
Posted on by 9

In my Sharepoint list ("OriginalSharepointList") I have a column with a combobox with the option to type an entry. You can select multiple already existing options or you can enter your own option (which will be an additional option from now on).

 

I would like to have the same functionality in my Power App. Unfortunately, when I use forms and Data Cards I can only choose between the options and also select multiple values. But the user can't add an entry.

 

I tried two things, both didn't work:

 

1) I activated the option in the Power Apps Combobox to be able to search for text. If the user wouldn't choose an already existing option the Data Card would update the entered search text. The problem with this approach is that the user can't choose already existing options AND add his/her own option. I got this solution from this thread: Combo Box Text Entry - Power Platform Community (microsoft.com)

 

2) My own approach was without Forms. I instead added a Textfield (TextInput_Add_Option) where the user can enter the new option. This would then get patched to its own Sharepoint list (DropdownSelection_SharepointList) where all the already existing options are being stored. With this Textfield the user can add as many option as he/she wants to.

 

 

Patch('DropdownSelection_SharepointList';Defaults('DropdownSelection_SharepointList');{Title:1; DataQuality: 'TextInput_Add_Option'.Text});;

 

 

The data source for the options of the Combobox (ComboBox_DataQuality) is this new Sharepoint list (DropdownSelection_SharepointList). This worked perfectly. The user is able to choose multiple options in the Combobox. Unfortunately, if I want to patch the selected options in the Combobox to the Sharepoint list (OriginalSharepointList) I get an error saying " a table entry with a different scheme was expected".

 

 

Patch(OriginalSharepointList;First( Filter( OriginalSharepointList; ItemID = SelectedGallery.ItemID));{DataQuality: ComboBox_DataQuality.SelectedItems})

 

 

 

What would be a solution for my problem?

Categories:
I have the same question (0)
  • Verified answer
    lukas38 Profile Picture
    9 on at

    Ok I figured it out. I sticked to option 2.

    The Combobox (ComboBox_DataQuality) doesn't get its option-data from the main list (OriginalSharePointList). I created a second list (DropdownSelection_SharepointList) with a column called DataQuality. The entries of this column are all the options that already existed in the original list.
    Next to the ComboBox I added a button. If the user clicks on it a TextInput gets displayed. The user can add another option simply by typing it into the TextInput. This gets patched into DropdownSelection_SharepointList.

     

    The ComboBox gets its data from this DropdownSelection_SharepointList and displays now - next to the old entries - the new entry of the user. The user is now able to select as many option as he/she wants to and also add new entries.
    If we want to patch the selection of the ComboBox:

    Clear(colDataQualityToPatch);;
    ForAll(ComboBox_DataQuality.SelectedItems;Collect(colDataQualityToPatch;{Id:ThisRecord.ID;Value:ThisRecord.DataQuality}));;
    
    Patch(OriginalSharepointList; First( Filter( OriginalSharepointList; Item_ID= SelectedGallery.Item_ID)); {DataQuality:colDataQualityToPatch});;

     If you want an explanation of the code, here's the video which explains it perfectly:

    https://www.youtube.com/watch?v=bmft4JFWJiY

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard