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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching Collection wi...
Power Apps
Answered

Patching Collection with Items not in the Collection to Dataverse

(0) ShareShare
ReportReport
Posted on by 239

Hi, 

Have a power app that I am working on that is an employee store, I have it setup so when an item is added to the cart, it is added to a collection, colCart. I am trying to set up the submit order section of the app and I am having a hard time getting the patch to work. 

 

I am trying to set it up so that a row on the dataverse table has the employee's name, email address, total cost and cart items. 

 

Any advice would be greatly appreciated. Thanks

 

Patch Error.jpg

 

Patch('AWC Transactions', 
Defaults('AWC Transactions'),
{
Name:TextInputName,
'Email Address':TextInputEmail, 
Items:colCart.ProductName, 
Total: LabelTotalAmount

}

);

 

 

 

Patch Error.jpg
Categories:
  • madlad Profile Picture
    2,637 Moderator on at

    perhaps you want to loop through the collection and patch, something along the lines of

    ForAll(
     colCart,
     Patch(
     'AWC Transactions',
     Defaults('AWC Transactions'),
     {
     Name:TextInputName,
     'Email Address':TextInputEmail, 
     Items:ThisRecord.ProductName, 
     Total: LabelTotalAmount
     }
     )
    )

     

    Hope this helps!

  • GF-02121351-0 Profile Picture
    239 on at

    @madlad 

    Thanks, I made your edits, but I can't test until I figure out the "Network error when using Patch function: The requested operation is invalid." error. Any ideas? 

  • madlad Profile Picture
    2,637 Moderator on at

    Are textInputName and textInputEmail controls?

    If so, you'll want to use textInputName.Text and textInputEmail.Text to reference the entered text.

     

    If that's not it I cant see anything else off the top of my head - perhaps you can use the monitor tool to find more details on this error? There's a lot of posts about this error but unfortunately it seems to be a fairly broad issue. 

  • Verified answer
    GF-02121351-0 Profile Picture
    239 on at

    It is working now. The code should have been: 

    ForAll(
    colTrans,
    Patch(
    'BeneStore Transactions',
    Defaults('BeneStore Transactions'),
    {
    Name: "Transaction",
    'Product Name': ProductName,
    'Product Category': ProductCategory,
    Quantity: Quantity,
    Email: Text(TextInputEmail_1.Text)
    }
    )
    )

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard