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 / Patch a collection row...
Power Apps
Unanswered

Patch a collection row multiple times based on number column

(0) ShareShare
ReportReport
Posted on by 159

Hello,

I have an inventory app and i want to save  articles from invoice to a sharepoint list. I add all the product from one invoice to a collection row by row..If column Quantity for an article (ProductName) is equal to 1 i want to patch that line once, other way i want to patch same article based on that quantity( two times or then, depending on quantity)

Can anybody help me?

Thanks 

 

The collection named col_InvoiceItems look like this:

ProductNameQuantityProductPrice
laptop12100
laptop21150
Phone325

 

See the code bellow for normal patch ...

ForAll(
col_InvoiceItems,
Patch(
ITInventory,
Defaults(ITInventory),
{
'Product': ThisRecord.Productname,
'Price': Value(ThisRecord.ProductPrice)
}
)
)

 

 

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

    Hi @ciprianpopovici 

     

    You need the ForAll function twice to achieve the functionality.

    I have made a test for your reference:

    vliweimsft_0-1667807138467.pngvliweimsft_1-1667807147658.png

     

    vliweimsft_3-1667807259466.png

     

     

    ForAll(
     col,
     ForAll(
     Sequence(Quantity),
     Patch(
     '1026',
     Defaults('1026'),
     {
     Title: ProductName,
     price: ProductPrice
     }
     )
     )
    )

     

     

     

    Best Regards,

    Levi

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard