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 Apps
Unanswered

Error with patch

(0) ShareShare
ReportReport
Posted on by 388

I get this error 

steve_hendy_0-1696512249537.png

 

This is my code and the last line doesn't work and causes the error above!

ClearCollect(
 col_RecordsToPatch,
 ForAll(
 varSampleNumberSequence,
 {
 Proposal: DataCardValueProposal.Text,
 Phase: varPhase,
 'Service Line': {Value: varServiceLine},
 'Sample ID': Upper(TextSampleIDPrefix.Text) & Text(
 ThisRecord.Value,
 "000"
 ),
 'Sample Group Name': DataCardValueSampleGroupName.Text,
 'Sample Description': DataCardValueSampleDescription.Text,
 'RINew Refs': lbl_RinewRefs.Text,
 'Sample Storage Location': {Value: DataCardValueStorageLocation.Selected.Value},
 Customer: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Id: Value(lbl_CustomerID.Text),
 Value: lbl_Customer.Text
 },
 'Received Date': DataCardValueReceivedDate.SelectedDate,
 'Expected Disposal': DataCardValueExpectedDisposal.SelectedDate,
 'Sample Owner': {
 Claims: "i:0#.f|membership|" & varSelectedSampleOwnerEmail,
 Department: "",
 DisplayName: "",
 Email: varSelectedSampleOwnerEmail,
 JobTitle: "",
 Picture: ""
 },
 'Received by': {
 Claims: "i:0#.f|membership|" & varSelectedSampleReceivedByEmail,
 Department: "",
 DisplayName: "",
 Email: varSelectedSampleReceivedByEmail,
 JobTitle: "",
 Picture: ""
 },
 'Proposal Author': {
 Claims: "i:0#.f|membership|" & varProposalAuthor,
 Department: "",
 DisplayName: "",
 Email: varProposalAuthor,
 JobTitle: "",
 Picture: ""
 },
 'Added to Sample Manager': DataCardValueServiceManager.Value
 }
 )
 );
 Patch('Sample Inventory',Defaults( 'Sample Inventory'),col_RecordsToPatch);

This was my code that worked but was too slow I'm trying to use the code above to speed up the patching but it doesn't work.  Does anyone know how to fix this issue?

ForAll(
 varSampleNumberSequence,
 Patch(
 'Sample Inventory',
 Defaults('Sample Inventory'),
 {
 Proposal: DataCardValueProposal.Text,
 Phase: varPhase,
 'Service Line': {Value: varServiceLine},
 'Sample ID': Upper(TextSampleIDPrefix.Text) & Text(
 ThisRecord.Value,
 "000"
 ),
 'Sample Group Name': DataCardValueSampleGroupName.Text,
 'Sample Description': DataCardValueSampleDescription.Text,
 'RINew Refs': lbl_RinewRefs.Text,
 'Sample Storage Location': {Value: DataCardValueStorageLocation.Selected.Value},
 Customer: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Id: Value(lbl_CustomerID.Text),
 Value: lbl_Customer.Text
 },
 'Received Date': DataCardValueReceivedDate.SelectedDate,
 'Expected Disposal': DataCardValueExpectedDisposal.SelectedDate,
 'Sample Owner': {
 Claims: "i:0#.f|membership|" & varSelectedSampleOwnerEmail,
 Department: "",
 DisplayName: "",
 Email: varSelectedSampleOwnerEmail,
 JobTitle: "",
 Picture: ""
 },
 'Received by': {
 Claims: "i:0#.f|membership|" & varSelectedSampleReceivedByEmail,
 Department: "",
 DisplayName: "",
 Email: varSelectedSampleReceivedByEmail,
 JobTitle: "",
 Picture: ""
 },
 'Proposal Author': {
 Claims: "i:0#.f|membership|" & varProposalAuthor,
 Department: "",
 DisplayName: "",
 Email: varProposalAuthor,
 JobTitle: "",
 Picture: ""
 },
 'Added to Sample Manager': DataCardValueServiceManager.Value
 }
 )
 );

 

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @steve_hendy ,

     

    Please try this formula instead:

     Collect('Sample Inventory',col_RecordsToPatch);

     

    Best Regards,

    Bof

  • steve_hendy Profile Picture
    388 on at

    didn't work 

    steve_hendy_0-1696605754575.png

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard