Error Handling and Show Error Message from API in Canvas App
Patch(
Tests,
Defaults(Tests),
{Text: "Power Apps Test"}
) Set(
varSearchResults,
CustomConnector.Search(
{SearchText: "Power Apps"}
)
)
IfError function is part of an experimental feature and are subject to change. That function is available only when the Formula-level error management experimental feature in Settings > Upcoming features > Experimental is turned on. (Yes, you read it right. It is still an *experimental* feature after more than 4 years and counting.)
IfError(,
Patch(
Tests,
Defaults(Tests),
{Text: "Power Apps Test"}
)
Notify(
"There is an error while creating a row in Test table.",
NotificationType.Error,
5000
),
false
);
IfError(,
Patch(
Tests,
Defaults(Tests),
{Text: "Power Apps Test"}
)
Notify(
FirstError.Details.HttpResponse,
NotificationType.Error,
5000
),
false
);
IfError(,
Patch(
Tests,
Defaults(Tests),
{Text: "Power Apps Test"}
)
Notify(
Match(
FirstError.Details.HttpResponse,
"\""code"":""(?<code>[^""]*)"",""message"":""(?<message>[^""]*)"
).message,
NotificationType.Error,
5000
),
false
);
Set(varSearchResults, Blank());
Set(varMessage, "Loading...");
Set(
varSearchResults,
IfError(
CustomConnector.Search(
{SearchText: "Power Apps"}
),
Set(
varMessage,
Match(
FirstError.Details.HttpResponse,
"\""code"":""(?<code>[^""]*)"",""message"":""(?<message>[^""]*)"
).message
),
If (
(CountRows(varSearchResults) > 0),
Set(varMessage, ""),
Set(varMessage, "No data available"});
);
);
);
Summary
Published on:
Learn moreRelated posts
Power Apps – Deprecation of Maker Copilot in canvas apps
We are announcing the deprecation of the Edit your app with Copilot in Power Apps Studio (preview) in canvas apps. The deprecation will begin ...
Set Combo Box Value Dynamically by other Combo Box Value in Canvas APP
In this post You will come to know how to Set Default Selected Items of a Combo Box as per value selected in another Combo BOX. Problem Statem...
Power Apps – Create offline profiles in the maker studio for Canvas apps
We are announcing the ability to create offline profiles in the maker studio for Canvas apps in Power Apps. This feature will reach general av...
Power Apps – Create offline profiles in the maker studio for Canvas apps
We are announcing the ability to create offline profiles in the maker studio for Canvas apps in Power Apps. This feature will reach general av...
Power Apps – Manage your source code for canvas apps
We are announcing the ability to manage your source code for canvas apps in Power Apps. This feature will reach general availability on Septem...
Embedding Canvas Apps into Model-Driven Forms for a Unified Experience
In Microsoft Power Apps, there are two main application types—canvas apps and model-driven apps—each serving unique purposes. While model-driv...
Canvas App Error: “Row Size Exceeded” – Causes, Fixes, and Best Practices
When building Canvas Apps with Dataverse, you might see this error: The total size of the columns used in the database command exceeded t...





