Is there any way to get PowerApps error logs via API or something else? I would like to get the error logs of the PowerApps.
@Kamlesh780
If you need an example
Add this AppOnStart
Set(
gblAppGlobalName,
{
ApplicationName: "My Project Software",
ApplicationID: "17718e8c-f2e0-40e1-8be0-f1ab03e73ef7",
SessionID: Text(
Now(),
"ddmmyy-hhmmss"
)
}
);
Reuse gblAppGlobalName example to get app name gblAppGlobalName.ApplicationName
Backend SharePoint
Patch
Set(
gblError,
Patch(
'Error Log',
Defaults('Error Log'),
{
ControlName: "Test",
User: $"{gblCurrentUser.Title}. at{Now()}.",
ApplicationName:gblAppGlobalName.ApplicationName,
ApplicationID:gblAppGlobalName.ApplicationID,
SessionString:gblAppGlobalName.SessionID
}
)
);
If(
IsBlankOrError(gblError),
Error(
{
Message: "Patch failed",
Kind: ErrorKind.GeneratedValue,
Source: "Button25"
}
)
)
Easier way to do it is hard coded on OnAppStart and added when patching to list you created for the error to capture so it will also added if any error occurs
Hi @Ramole ,
Thank you for your response 😊
This is the good one, but I have a few existing PowerApps and want to get error logs for all existing apps without updating them. I would like to get error logs by providing a PowerApp ID.
Hi @v-xiaochen-msft ,
Thank you for your response.
But I cannot use upcoming features (preview, experimental, or retired) in my project.
Hi @Kamlesh780 ,
At my knowledge, we can use Application Insights to get powerapps error logs.
https://sharepains.com/2022/08/09/power-apps-azure-application-insight/
Best Regards,
Wearsky
Hi @Kamlesh780
Am not aware if there is a API for that but here is an example explained by Shane Young which you can create a SharePoint list to handle and capture all errors on your app
Power Apps OnError to capture, suppress, and report all errors
WarrenBelz
146,776
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional