Skip to main content

Notifications

Community site session details

Community site session details

Session Id : APsTniRTyPo1OWh94m795G
Power Apps - Building Power Apps
Unanswered

Patch a collection to a single record

Like (0) ShareShare
ReportReport
Posted on 14 Mar 2025 05:15:03 by
Hi all, I am struggling on this one.
 
I have a collection that's created in my app that gathers 4 columns of data however I need to be able to patch all values to a single record in my SharePoint list. Any Ideas? Thanks
 
Collection:
Qty Description UnitPrice TotalPrice
1      Test            $100        $100
2      Test            $100        $200
3      Test            $100        $300
 
Record:
Qty1:         Description1:      UnitPrice1:      TotalPrice1:     Qty2:     Description2:      UnitPrice2:      TotalPrice2:      Qty3:         Description3:      UnitPrice3:      TotalPrice3: 
Categories:
  • MSR@08012015 Profile Picture
    542 on 14 Mar 2025 at 05:29:19
    Patch a collection to a single record
    Hi,
     
    Lets create a collection based on your requirement.
     
    ClearCollect(ColName,
    {
    //Record 1
    },
    {
    //Record 2
    },
    {
    //Record 3
    }
    )
     
    Patch
    
    Patch(DataSource, Lookup (or) Defaults ,
    {
    Qty:First(ColName).Qty,
    Description1:First(ColName).Description,
    UnitPrice1:First(ColName).UnitPrice,
    TotalPrice1:First(ColName).TotalPrice,
    
    Qty2:First(ColName,1).Qty,
    Description2:First(ColName,1).Description,
    UnitPrice2:First(ColName,1).UnitPrice
    TotalPrice2:First(ColName,1).TotalPrice,
    
    Qty3:First(ColName,2).Qty,
    Description3:First(ColName,2).Description,
    UnitPrice3:First(ColName,2).UnitPrice
    TotalPrice3:First(ColName,2).TotalPrice,
    
    }
    )
     
    This is the static way assume its only having 3 records, if you need dynamic way using ForAll we need to loop and update accordingly.
     
    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
     
     

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,382 Most Valuable Professional

Leaderboard
Loading started
Loading complete