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 / 3.22041: changes in th...
Power Apps
Unanswered

3.22041: changes in the ForAll function with error evaluations

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Summary: Starting in version 3.22041 of Power Apps Studio (which should start rolling out to the Preview region in the week of April 4th), if the result of one of the expressions in the ForAll function is an error, then the ForAll expression will return an error - meaning that something like an expression like the one below can now be used to catch errors from data sources:

IfError(
 ForAll(
 myCache As c,
 Patch(MyDataSource, Id = c.Id, { Value: c.Value })),
 Notify(
 "Error patching data from the collection! Total of " &
 CountRows(AllErrors) &
 " errors."))

This only applies to apps with the 'Formula-level error management' feature enabled.

 

More details: following some feedback from the community, we had previously changed other functions that used to return collections with nested errors (such as [Clear]Collect, see this post for more details). On versions prior to 3.22041, the ForAll function would always return a valid collection, but if any of the expressions returned an error, that error would be stored in the collection itself - making it harder to make sense of its errors. Starting on version 3.22041, the ForAll function now has a similar behavior to [Clear]Collect: it will return the error(s) from the expression evaluations. That allows for apps to handle these errors and notify the users directly:

IfError(
 ForAll(myLocalCache, Collect(myDataSource, ThisRecord)),
 Notify("Errors adding data to the data source!"))

Or tracing detailed information about the errors:

IfError(
 ForAll(myLocalCache, Collect(myDataSource, ThisRecord)),
 Trace("Error flushing local cache", TraceSeverity.Error, { errors: AllErrors });
 Notify("Errors adding data to the data source"))

Hopefully this helps understanding this recent change. As usual, we want your feedback (and we're making changes based on it)! Let us know if you have any questions, concerns, suggestions or bug reports on the error handling feature.

Categories:
I have the same question (0)

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard