Forum Discussion
error.record function does not produce info when installed as an app
- 1 year ago
Hi kadirkkkk ,
Thanks for reaching out to the Microsoft fabric community forum.
Akash_VarunaThanks for your prompt response
kadirkkkkThanks for flagging this. After further analysis, this is expected behavior in Power BI when using Template Apps.
In external tenants (where the app is installed), Power BI suppresses custom error messages created with error.record() or try ... otherwise error logic. This is likely due to privacy and security constraints in multi-tenant environments
let
result = try MyStep,
output = if result[HasError] then
[Status = "Error", Message = "Custom error message here"]
else
result[Value]
in
outputThis ensures your message will appear consistently across tenants and within the installed app.
M Language Error Handling - PowerQuery M | Microsoft Learn
Error handling - Power Query | Microsoft LearnIf this post helped resolve your issue, please consider giving it Kudos and marking it as the Accepted Solution. This not only acknowledges the support provided but also helps other community members find relevant solutions more easily.
We appreciate your engagement and thank you for being an active part of the community.
Best regards,
LakshmiNarayana. - 1 year ago
Hi kadirkkkk ,
In this scenario i suggest you raise a support ticket here. so, that they can assist you in addressing the issue you are facing. please follow below link on how to raise a support ticket:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
If my response has resolved your query, please mark it as the 'Accepted Solution' to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.
Best Regards
LakshmiNarayana.
Hi kadirkkkk
You're likely encountering a bug or limitation in Power BI's handling of custom error messages when using try ... otherwise blocks in Power Query within a template app. In your source workspace, everything works as expected—the custom error message you define using error record is displayed correctly when an error is triggered. However, after publishing the report and semantic model as part of a template app and installing it in another tenant, the same error scenario does not show the custom message. This inconsistent behavior suggests that Power BI may be suppressing or handling errors differently in cross-tenant template app environments, possibly due to sandboxing, security restrictions, or the read-only nature of installed template apps. As a result, the error function may not behave the same way, which can make debugging or user-friendly messaging unreliable in the installed version. As a workaround, instead of using the error function directly, consider returning a custom record or flag with diagnostic messages, which are more likely to appear consistently. Given that this issue affects usability and debugging, it’s worth reporting it to Microsoft through the Power BI Support portal and raising awareness on the Power BI Community forums to determine if others are facing the same issue.