Category: Error Handling | Works in: Canvas Apps
IsError tests if a value is an error record. IfError evaluates an expression and returns an alternative value if it results in an error.
IsError( Value )
IfError( Value, Fallback [, Value2, Fallback2, ...] )
Set(varResult, Patch(Tasks, Defaults(Tasks), { Title: txtTitle.Text }));
If(IsError(varResult), Notify("Save failed.", NotificationType.Error))
IfError(Value(txtQty.Text), 0)
IfError(LookUp(Products, ID = varID).Price, 0)
Set(varResult, Patch(Orders, Defaults(Orders), { Title: txtTitle.Text, Total: varTotal }));
If(
IsError(varResult),
Notify("Save failed: " & varResult.Message, NotificationType.Error, 6000);
Trace("Patch failed", TraceSeverity.Error, { Msg: varResult.Message }),
Notify("Order #" & varResult.ID & " created!", NotificationType.Success);
Navigate(OrdersScreen)
)
Set(varData, IfError(
Filter(LiveData, AssignedTo = User().Email),
varCachedData
))
// Label Text — show calculated value or dash if it errors
IfError(
Text(Gallery1.Selected.UnitPrice * Value(txtQty.Text), "$#,##0.00"),
"—"
)
- Validate inputs before using in write operations.
- Combine with related functions for complete workflows.
- Test with both empty and populated data sources.
- Consider delegation when working with large data sets.
| Function | Relationship |
|---|---|
Patch |
Related function |
Notify |
Related function |
Trace |
Related function |
IfError |
Related function |
IsError, IfError – Microsoft Learn
← Back to Home | Power Apps Formulas Reference | Last updated: May 2026