web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

save multiple values in one row in a collection and patch to sharepoint

(0) ShareShare
ReportReport
Posted on by 304

Hello,

I built an app with multiple fields (comboboxes) and checkboxes next to them. I set the OnCheck and OnUncheck properties, so that if the checkbox is checked, the item from the combobox is saved to a collection (with collect function) and if the checkbox is unchecked, it is removed again. So far, so good.

My problem is that everytime a checkbox is checked, it always creates a new row in the collection, like this:

cmValue1cmValue2
abc 
 xyz

 

But I need everything to be in just one row, like this:

cmValue1cmValue2
abc

xyz

 

I need it that way, because I'll patch it to a sharepoint list and there should be only one record per patch. Is there a way to achieve what I want? Also suggest anything without a collection, if there's something, please.

Thanks in advance!

I have the same question (0)
  • Verified answer
    CU05110754-0 Profile Picture
    4,982 Super User 2025 Season 2 on at
    Re: save multiple values in one row in a collection and patch to sharepoint

    Hello @LisKr ,

     

    Is the number of columns fixed? 
    Can you try the following for adding a value to your collection: 

    //OnCheck
    If(IsEmpty(collectionName), Collect(collectionName,{ColumnName:"Value"}), Pacth(collectionName,First(collectionName),{ColumnName:"Value"}))
    
    //On Uncheck
    Pacth(collectionName,First(collectionName),{ColumnName:Blank()}))
  • LisKr Profile Picture
    304 on at
    Re: save multiple values in one row in a collection and patch to sharepoint

    Hi @DBO_DV ,

    that's exactly what I needed. Thank you very much!

     

    So the key to achieving that is basically Patch + First function combined. Didn't think of that before.

  • CU05110754-0 Profile Picture
    4,982 Super User 2025 Season 2 on at
    Re: save multiple values in one row in a collection and patch to sharepoint

    Happy i could help.

     

    Basically you can see a Collection as a normal table. Power apps doesn't make any difference between Tables and collections. So every formula you can use on a table you can also use on a collection. 

     

  • LisKr Profile Picture
    304 on at
    Re: save multiple values in one row in a collection and patch to sharepoint

    Oh, I didn't know that! I'm sure that will help me in the future 🙂

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 652 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 410 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 236

Last 30 days Overall leaderboard