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 / Validating a ForAll Pa...
Power Apps
Unanswered

Validating a ForAll Patch Function

(0) ShareShare
ReportReport
Posted on by 9

I have a gallery of with input fields that I patch into the database. Is there a way to validate the patch has been successful or not?

 

ForAll('Gallery1'.AllItems,
Patch('Sharepoint List', {
Title : 'Combobox_1'.Selected.Code,
'Delivery Note' : 'TextInput_1'.Text,
}
);
);

 I have tried to make use of Errors function, made a field required in the list, and tried patching an empty data into it, but it returned Patch successful.

ForAll('Gallery1'.AllItems,
Patch('Sharepoint List', {
Title : 'Combobox_1'.Selected.Code,
'Delivery Note' : 'TextInput_1'.Text,
}
);
);
If(
IsEmpty(
Errors('Sharepoint List')
),
Notify("Patch Successful",NotificationType.Success),
Notify("There is an error with your Patch function",NotificationType.Error)
);

 

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @alJohSe ,

     

    Can you try the following code?

    Clear(colErrors);
    
    ForAll(
     'Gallery1'.AllItems,
     IfError(
     Patch(
     'Sharepoint List',
     ThisRecord,
     {
     Title : 'Combobox_1'.Selected.Code,
     'Delivery Note' : 'TextInput_1'.Text
     }
     ),
     Collect(colErrors, {Title: 'Combobox_1'.Selected.Code, Message: FirstError.Message});
     )
    );
    
    If(
     CountRows(colErrors) > 0,
     Notify("There is an error with your Patch function",NotificationType.Error, 2000),
     Notify("Patch Successful",NotificationType.Success, 1000)
    )

     

    Hope this helps

  • alJohSe Profile Picture
    9 on at

    Hey @Ethan_R , thank you for the reply.

     

    I tried implementing the code you shared, but it runs into an error (invalid argument type table expecting a record value instead)

    ForAll(Gallery2.AllItems,
     IfError( 
     Patch(
     'Testing Test',
     LookUp('Testing Test',id0 = TextInput2.Text),
     {
     Title: TextInput1.Text}),
     Collect(colErrors,
     {
     Title:TextInput1.Text,
     Message:FirstError.Message
     }
     )
     );
    );

    However, the code runs fine if I remove the ForAll function.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 993

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 545

Last 30 days Overall leaderboard