Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Error Handling
Unanswered

3.21122: Filter behavior change with errors

(0) ShareShare
ReportReport
Posted on by

Summary: Starting in version 3.21122 of Power Apps Studio, if the predicate of a Filter function returns an error, the result of the function will have an error record (before the error was ignored). Only applied for apps with the 'Formula-level error management' feature enabled. We don't expect many apps to be affected, but this is a fundamental change that deserves a longer explanation.

 

More details: As we get closer to changing the error handling feature from experimental to preview, we made a change on how filtering works when the expression that is used to filter the source returns an error. Let's take this example:

 

ClearCollect(
 companies,
 { Company: "AdventureWorks Cycles", Profits: 200000 },
 { Company: "Contoso Ltd.", Profits: 1350000 },
 { Company: "Fourth Coffee", Profits: -150000 },
 { Company: "LitWare Inc", Profits: 400000 },
 { Company: "Woodgrove Bank", Profits: 3500000 })

 

We want to know which companies had profits in the 7+ digits, so we can use an expression like the one below (yes, I know we could use Profits > 1000000, but this is just an example to illustrate the change) in the Items property of a gallery:

 

Filter(companies, Log(Profits) > 6)

 

The Log function can only be used with positive numbers, so evaluating it for the third row of the input will generate an error. The expression returns true for the second (Contoso) and last (Woodgrove) records. Before the change, the error would be ignored, and that record result would not be part of the result:

Post001.png

We believe that (silently) ignoring errors is a bad thing to do. If something is wrong, the maker and/or the user should be notified that this is the case so that they don't operate on faulty data.

 

With the change done in the 3.21122 release, if the predicate used to filter the record returns an error, then the result of the filter will have an error record in that place. The result will have all of the records that satisfy the predicate(s) passed to the Filter function, plus all error records corresponding to those which caused the predicate(s) to return an error.

Post002.png

A little side note: the notification banner for the error is also a new change introduced in this release; for more information see https://aka.ms/powerapps-errornotification.

 

Back to the Filter change. An error record is something that we can reason about. For example, we can change the TemplateFill property of the gallery to check if the entire record that we are displaying is an error, and show something different to the user:

Post002.5.png

We can also check the fields of the record. Any field of an error record will be an error itself, so we can use that to display additional information to the user as well:

Post002.6.png

To go back to the previous behavior, we can "capture" the error in the predicate itself, using the IfError function - this way the maker is being explicit in handling the error.

Post003.png

Hopefully this helps understanding this new concept that has been added. We will have more detailed information in the official documentation when this release is deployed worldwide. As usual, we want your feedback! Let us know if you have any questions, concerns, suggestions or bug reports on the error handling feature!

 

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Error Handling

#1
stampcoin Profile Picture

stampcoin 84

#2
DS-11051211-0 Profile Picture

DS-11051211-0 20

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 9

Overall leaderboard

Featured topics