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 / Combobox multiple sele...
Power Apps
Answered

Combobox multiple selection

(0) ShareShare
ReportReport
Posted on by 69

Hi powerapps community,

 

i have a combobox which allows multiple selection, when i am trying to patch the values back to my database table, it only patches one value and not the rest? im trying something like this 

ForAll(ComboBox1.SelectedItems,Patch( source,Defaults(source),{Data_Integrity_Test_Case_Id: 45,Data_Integrity_Systems_Id:ComboBox1.Selected.ID}))

 

this code only patches one value instead on multiple. And also it is supposed to create a new row when a new value is patched 

 

Thanks in advance ! 

Categories:
  • AndySid Profile Picture
    165 on at

     

    Hi, do you want to make a new record for each comboBox item? The code below does that or modify for your requirement.

    Also you may need to specify the field in the combo, like this:  cboEmployee.SelectedItems.Employee

     

    ForAll(
        cboEmployee.SelectedItems.Employee,
         Patch(
            appDailyJobSheets_1,
            Defaults(appDailyJobSheets_1),
            {
                ContractNo: cboDropContractNo_2.Selected.Contract,
                CategoryID: cboCategory_2.Selected.Result,
                Added: Today(),
                ),
                Employee: Employee
            }
        )
    )

     

    >>If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.<<

  • Verified answer
    v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @Shafeel_07,

     

    Do you want to patch combo box select items to one field?

    What is your data source?

    And what the column type of Data_Integrity_Sytems_Id and Data_Integrity_Test_Case_Id?

    Do you want to patch multiple items to multiple rows or to one field?

    I think there is some wrong for your formula, If you want to Patch multiple combobox items,you should use,combobox.selectitems, combobox.seleted.id can only be one item. 

    I test with SP list as data source, I think you can try following workaround.

     

    Method1:Number type of Data_Integrity_Systems_Id and multiple items to multiple rows.

    Data Source:

    2019PatchComboboxmutiple(my SP list name)

    Data_Integrity_Test_Case_Id (Number type)

    Data_Integrity_Systems_Id (Number type)

    20190208patchcomboboxmethod1sp1.png

    App Test:

    ComboBox1.Items:'2019PatchComboboxmutiple'.Data_Integrity_Systems_Id

    Button1.OnSelect: ClearCollect(comtest,ComboBox1.SelectedItems);ForAll(comtest,Patch('2019PatchComboboxmutiple',Defaults('2019PatchComboboxmutiple'),{Title:6,Data_Integrity_Test_Case_Id

    :45,Data_Integrity_Systems_Id:comtest[@Data_Integrity_Systems_Id]}))

     20190208method1apptest1.jpg

    Result Test:

    20190207patchcomboboxselectresulttestmethod1.gif

    20190208method1resulttestsp1.png

    Method2:Single line type and multiple items to one field

    Data Source:

    2019PatchComboboxmutiple(my SP list name)

    Data_Integrity_Test_Case_Id (Number type)

    Data_Integrity_Systems_Id (Single line )

     20190208method2sp2.png

    App Test:

    ComboBox1.Items:'2019PatchComboboxmutiple'.Data_Integrity_Systems_Id

    Button1.OnSelect: Patch('2019PatchComboboxmutiple',Defaults('2019PatchComboboxmutiple'),{Title:4,Data_Integrity_Test_Case_Id:45,Data_Integrity_Systems_Id

    :Concat(ComboBox1.SelectedItems,Data_Integrity_Systems_Id&",")})

    20190208method2apptest2.jpg

    On your side :

    Patch(‘source’,Defaults('source'),{Data_Integrity_Test_Case_Id:45,Data_Integrity_Systems_Id

    :Concat(ComboBox1.SelectedItems,Data_Integrity_Systems_Id&",")})

     

    Result Test:

    20190207patchcomboboxselectresulttestmethod2.gif

    20190208method2resulttestsp2.png

     

     

    Hope this can be helpful.

    Best Regards.

    Yumia

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi 

     

    And if I want to later edit the information of ShP in powerapps with the format of combobox in line of a line of text?
    For example, when selecting an element of a gallery a combobox take the saved data of the selected element from ShP and can edit the multiple selection and then update that information again in ShP in the same record Problema.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi dear @v-yuxima-msft ,

    I have the same problem as the author.

    And i create an apps as your solution.

    My SharePoint List Name: Shift Turn Registration

    Share Point Column Name: TeamMember

     

    But apps pop up an alert like this:1.png

     

    My Formula like this:

    2.png

    Although i created an list and apps same with yours, it also have the same alert.

    Could u please help?

    Thank u sooooooo much!

  • EJ-07080649-0 Profile Picture
    106 on at

    Is it correct that;

    - You can store comma seperated data to a MSSQL table database as a string from a multiselection
    - You can not retrieve data from an MSSQL table to a multiselection Combox because MSSQL do not have a record infotype / fieldtype?

    - The Default property in PowerApp/multiselection combobox expect a record value and will not accept a text string. 

     

    It nice to save time by not searching for answers (how to use a multiselection combobox with MSSQL) when there are none.

     

    That for any reply!

  • Akshaypanjwani Profile Picture
    4 on at

    I am doing same thing but not working on patch function.
    Capture.PNG

    here I am saving data and getting error.

    Capture2.PNG

     

    thanks in advance.

     

  • Tapesh Profile Picture
    825 on at

    Hi 

     

    Just wanted to know more as im also facing the same issue since long time and no answers around as such. 

    I feel that this is some what same as i wanted to achieve. 

    To be more precise on this, can you just explain how the same out can be achieved in terms of updating the columns and not rows?

     

    Please  

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-yuxima-msft 

    Combobox Item:Distinct(Filter(PRODUCT_TABLE,Label14.Text=Client),'Product Name')

    I am trying to follow your formula and I am getting this error.

    image.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Please what is 'comtest'  on the ClearCollect synatx ?

  • Shafeel_07 Profile Picture
    69 on at

    @Anonymous Its a collection you want to add data to. 

    Please refer to Collect, Clear, and ClearCollect functions in Power Apps 

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 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard