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 / Help with Patching a c...
Power Apps
Answered

Help with Patching a collection to a choice column in a sharepoint list

(0) ShareShare
ReportReport
Posted on by

Greetings,
I have a sharepoint list with a choice column that allows multiple selections. I have a power app with a group of drop downs that allow me to concatenate a quantity with an item from a drop down. The result is added to a collection for as many items as needed. What I am having trouble understanding is how to patch the whole collection to a single record with a choice column with multiple entries per list record.

Example:

Listbox1 allows selection of a quantity 1 -10

Listbox2 contains a list of items selected one at a time

After a Concat the Collection contains multiple records in the following format:

 

1 - Dog

3 - Dog

1- Cat

2 - Cat

etc...


How do I patch the multiple items in this single column collection to a single entry in a choice column that allows multiple selections in a Sharepoint list?

Thanks in advance!

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Anonymous ,

     

    There's a lot of context missing, so probably this will not work on the first try, but let's figure this out as we go along.

     

    The first thought:

     

    Patch(
     DataSourceName,
     ItemToPatch,
     {
     ColumnName: CollectionName
     }
    )

     

     In this pretty much everything will need to be replaced with the proper identifiers/references: DataSourceName, ItemToPatch, ColumnName, CollectionName.

  • Community Power Platform Member Profile Picture
    on at

    Patch(
    'Status-NOTL-DEV',

    Gear,

    {Gear: GearInfo}
    )

     

     

    It would appear I'm not clear on (itemToPatch)

    The above gives the following error although it is the column name in the datasource I am trying to patch.

     

    "Name isn't Valid. 'Gear' isn't recognized."

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Anonymous ,

     

    ItemToPatch is a reference that selects the item that is to be patched in case you want to edit an existing item or to indicate that a new item is to be created. In case you want to create a new item, the Defaults function is to be used:

     

    Patch(
     'Status-NOTL_DEV',
     Defaults('Status-NOTL_DEV'),
     {
     Gear: GearInfo
     }
    )
  • Community Power Platform Member Profile Picture
    on at

    PAC.png

     
    I think the flaw is in my lack of understanding.  Thanks for your patience.

     

    This type of Argument 'Gear' does not match the expected type 'Record'. Found type 'Table'.

    I've included all of the functions being used in the button for you to see. This will need to work for new records and edits.

     

    Gear is  choice column in the list

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Anonymous ,

     

    If the Gear column expects a Record instead of a Table, this means it does not allow for multi selection. Can you please check the settings in SharePoint to confirm?

  • Community Power Platform Member Profile Picture
    on at

    Multiple selections was on, however 'Can add values manually' was unchecked. Changing this didn't help. I think I understand what's wrong.   I need to modify my list for this test. I was working with a copy of an existing list that has 10 columns, one of which is mandatory so I think that is causing trouble.

    I made a new list with 2 columns  Just 'Title' and 'Gear' 

    Gear is a choice column with allow multiple turned on and can add values manually checked.

    Still getting the Table vs Record mismatch.

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Anonymous ,

     

    When testing this scenario myself I had no issues. In the below screenshot you see a patch for a single selection Choice column (Choice) and a multi select Choice colum (MultiChoice). The square brackets indicate I'm trying to patch a table to the MultiChoice column which is accepted without issues:

     

    BCBuizer_1-1682323605290.png

     

    Having said that, the issue may be with the way your collection is structured. Can you please share the structure?

  • Community Power Platform Member Profile Picture
    on at

    It is very simple. It has one Column.
    First I set a variable 'myVar' by concatenating the text values from Dropdown_Qty and Dropdown_Gear_item:

     

    Set(myVar,"("& Dropdown_Qty.Selected.Label &")" &" "& Dropdown_Gear_item.Selected.Item);


    Then the collection is made like this: 

     

    Collect(GearInfo,{Gear:myVar});

     

    So is it because my collection only has on column?



  • Community Power Platform Member Profile Picture
    on at

    Thank you BC - You had it right, I was mistaken about having Multiple choices turned on. My bad.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard