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 / Patch combobox multipl...
Power Apps
Unanswered

Patch combobox multiple selection to a choice field SharePoint list

(0) ShareShare
ReportReport
Posted on by 57

Hi,

 

I have a SharePoint list with a choice field and I am trying to Patch the combo box selected values from PowerApps to SP list. Below is the code I am using but it doesn't seem to work.

Snacham_0-1653333490237.png

I am trying to save all selected items from Combobox to choice field in a SP list. Choice field in SP list not enabled for multiple selection values because if I enable it I am receiving an error on the Default property of the datacard of the combobox. 

Items Property of Combobox - BE-Market list (column-Title)

DefaultSelectedItems - Parent.Default

Default of the datacard - ThisItem.MarketList

 

Please assist and let me know if you have any further questions.

 

Thanks,

Categories:
  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    Hi @Snacham ,

    Can you please post that code in Text.

  • Snacham Profile Picture
    57 on at

    Hi @WarrenBelz,

     

    Here is the code -

    'Market List':ForAll(cmbMarketList.SelectedItems,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Value:Title})

     

    Thanks,

    Sadhana

  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    @Snacham ,

    I meant the full code as I was looking for a possible structure issue, but firstly you do not need the 'odata' reference

    'Market List':
    ForAll(
     cmbMarketList.SelectedItems,
     {Value: Title}
    )

    however, if you are patching to a multi-value Choice field and the output of cmbMarket is cmbMarket.Selected.Title, then the above is correct.

     

    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

  • Snacham Profile Picture
    57 on at

    Sorry about that I thought just MarketList. Here is the code -


    'Billing Estimate',
    Defaults('Billing Estimate'),
    {
    Title:txtEstimateGroup.Text,
    'Client Name':{Value:cmbClientName.Selected.Result},
    'Market List': ForAll( cmbMarketList.SelectedItems, {Value: Title} )

    }

     

    But I am still receiving the same error even with the above code that says - Expected Type Record but found type Table.

     

    Thanks,

    Sadhana

    )

  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    Hi @Snacham ,

    I needed to check that in case the error was in the structure, however

    Patch(
     'Billing Estimate',
     Defaults('Billing Estimate'),
     { 
     Title: txtEstimateGroup.Text,
     'Client Name': {Value:cmbClientName.Selected.Result},
     'Market List': 
     ForAll( 
     cmbMarketList.SelectedItems, 
     {Value: Title} 
     )
     }
    )

    looks correct to me assuming

    • You are writing a new record to the List 'Billing Estimate'
    • The Title (Text) field now contains the txtEstimateGroup Text control
    • The Choice or Lookup field 'Client Name' now contains the (single) selection from cmbClientName, which contains a Distinct filter.
    • The multi-value Choice field 'Market List' now contains all selected items from cmbMarketList which is based on the Title field 

    Is any of this not correct ?

     

    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

  • Snacham Profile Picture
    57 on at

     

    Hi WarrenBelz,

     

    Yes, that's correct.

    I am able to patch values for Client Name and Title field but not for Market List field. Also in addition, I have Product field where 'Client Name' and 'Product Name' are cascading depending on the Client Name selected, respective Product Names will be displayed. When I use the below code I getting an error and adding the screenshots - 

    code-

    'Client Name': {Value:cmbClientName.Selected.Result}
    'Product Name'{Value:cmbProductName.Selected.'Core Product'}

    Here is the error screenshot -

    Snacham_1-1653349785014.png

     

    Thanks,

    Sadhana

     

     

  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    @Snacham ,

    You said it was a Choice column - it is actually a Lookup column (something best avoided in Power Apps unless you really need to use them) - you need to refer here to the list and field being looked up by this field

    Patch(
     'Billing Estimate',
     Defaults('Billing Estimate'),
     { 
     Title: txtEstimateGroup.Text,
     'Client Name': {Value:cmbClientName.Selected.Result},
     'Market List': 
     ForAll( 
     cmbMarketList.SelectedItems, 
     {
     Value: Title,
     Id: 
     LookUp(
     YourLookupUpList,
     YourLookupFieldName = Title
     ).ID
     } 
     )
     }
    )

     

    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

  • Snacham Profile Picture
    57 on at

    It is a choice column(not enabled multi selection but I am trying to Patch multiselected values from PowerApps) not Lookup column. But the datasource is coming from a different list.

    Snacham_0-1653352592192.png

     

    Below error occurred for Client Name and Product Name. These two fields are also choice type (single selection) and data source coming from different list.

     

    Snacham_1-1653352830463.png

     

    'Client Name': {Value:cmbClientName.Selected.Result},
    'Product Name'{Value:cmbProductName.Selected.'Core Product'}

     

    Thanks,

    Sadhana

     

     

  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    @Snacham ,

    How to you expect to patch multiple values to a column that is not multiple value enabled ? It is also a very strange error looking for a missing Id when this is normally part of a lookup column. Your original code is valid if your Choice column is multi-choice enabled.

  • Snacham Profile Picture
    57 on at

    Hi WarrenBelz,

     

    Thanks for helping me to figure out the issue here. I created the columns as lookup first and then changed to Choice fields so is the error in PowerApps.

     

    Thanks,

    Sadhana

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard