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 Platform Community / Forums / Power Apps / save multiple values i...
Power Apps
Unanswered

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!

Categories:
I have the same question (0)
  • Verified answer
    Daniel Bocklandt Profile Picture
    5,099 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.

  • Daniel Bocklandt Profile Picture
    5,099 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard