You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/power-platform/power-apps/create-and-use-apps/monitor-alternatives-canvas-apps.md
+33-33Lines changed: 33 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,9 @@ search.audienceType:
12
12
13
13
## Summary
14
14
15
-
This article describes alternative debugging approaches for Power Apps canvas apps when [Live monitor](/power-apps/maker/monitor-canvasapps) isn't available. Use these techniques for SharePoint integrated forms, custom pages, or custom portal embeddings where you can't open Live monitor alongside the app.
15
+
This article describes alternative debugging approaches for Power Apps [canvas apps](/power-apps/maker/canvas-apps/getting-started) when [Live monitor](/power-apps/maker/monitor-canvasapps) isn't available. Use these techniques for SharePoint integrated forms, custom pages, or custom portal embeddings where you can't open Live monitor alongside the app.
16
16
17
-
Live monitor is the recommended tool for debugging canvas apps because it displays real-time events and works with the [Trace function](/power-platform/power-fx/reference/function-trace). However, some hosted or embedded scenarios don't support it. This article covers alternatives such as Application Insights, Dataverse logging tables, SharePoint list logging, and on-screen diagnostics panels.
17
+
Live monitor is the recommended tool for debugging canvas apps because it displays real-time events and works with the [Trace function](/power-platform/power-fx/reference/function-trace). However, some hosted or embedded scenarios don't support it. This article covers alternatives such as Application Insights, [Dataverse](/power-apps/maker/data-platform/data-platform-intro) logging tables, SharePoint list logging, and on-screen diagnostics panels.
18
18
19
19
> [!NOTE]
20
20
> For scenarios where Live monitor is available, see [Debug canvas apps with Live monitor and Trace](monitor-debugging-canvas-apps.md).
@@ -44,21 +44,21 @@ For setup instructions, see [Analyze app telemetry using Application Insights](/
44
44
45
45
## Write debug records to Dataverse
46
46
47
-
If your environment includes Dataverse, create a custom **Debug Logs** table to capture diagnostic information. This approach works well for ad-hoc troubleshooting and audit trails.
47
+
If your environment includes Dataverse, create a custom `Debug Logs` table to capture diagnostic information. This approach works well for ad-hoc troubleshooting and audit trails.
48
48
49
49
### Create the Debug Logs table
50
50
51
-
1. In [Power Apps](https://make.powerapps.com), go to **Tables** and create a new table named **Debug Logs**.
51
+
1. In [Power Apps](https://make.powerapps.com), go to **Tables** and create a new table named `Debug Logs`.
52
52
1. Add the following columns:
53
-
-**Title** (Single line of text): A label for the log entry.
54
-
-**UserEmail** (Single line of text): The email of the user.
55
-
-**Timestamp** (Date and time): When the event occurred.
56
-
-**Payload** (Multiple lines of text): Additional data in JSON format.
57
-
- Add other columns as needed for your scenario (for example, **CartCount**, **ScreenName**).
53
+
-`Title`: A label for the log entry.
54
+
-`UserEmail`: The email of the user.
55
+
-`Timestamp`: When the event occurred.
56
+
-`Payload`: Additional data in JSON format.
57
+
- Add other columns as needed for your scenario (for example, `CartCount`, `ScreenName`).
58
58
59
59
### Example: Write a debug record to Dataverse
60
60
61
-
Use a guarded `Patch` call to write records only when a debug query string parameter is present:
61
+
Use a guarded [Patch](/power-platform/power-fx/reference/function-patch) call to write records only when a debug query string parameter is present:
62
62
63
63
```powerfx
64
64
If(Param("debug") = "true",
@@ -78,25 +78,26 @@ If(Param("debug") = "true",
78
78
79
79
### Run the app in debug mode
80
80
81
-
To enable debug logging, add `&debug=true` to the app URL:
81
+
To enable debug logging, add `&debug=true` to the app URL. For more information about query string parameters, see [Param function](/power-platform/power-fx/reference/function-param).
After reproducing the issue, open the **Debug Logs** table in Dataverse to review the captured records.
83
+
After reproducing the issue, open the `Debug Logs` table in Dataverse to review the captured records.
88
84
89
85
> [!NOTE]
90
86
> Remove or disable debug logging before you deploy the app broadly. Periodically delete old log entries to manage storage.
91
87
92
88
## Write debug records to SharePoint
93
89
94
-
For lightweight environments without Dataverse, use a SharePoint list to capture debug information.
90
+
For lightweight environments without Dataverse, use a [SharePoint](/connectors/sharepointonline/) list to capture debug information.
95
91
96
92
### Create the debug list
97
93
98
-
1. In SharePoint, create a new list named **AppDebugLogs**.
99
-
1. Add columns for **Title**, **UserEmail**, **Timestamp**, **Payload**, and any other data you want to capture.
94
+
1. In SharePoint, create a new list named `AppDebugLogs`.
95
+
1. Add the following columns:
96
+
-`Title`: A label for the log entry.
97
+
-`UserEmail`: The email of the user.
98
+
-`Timestamp`: When the event occurred.
99
+
-`Payload`: Additional data in JSON format.
100
+
- Add other columns as needed for your scenario.
100
101
101
102
### Example: Write a debug record to SharePoint
102
103
@@ -122,9 +123,9 @@ If(Param("debug") = "true",
122
123
123
124
For immediate feedback during testing, create a diagnostics panel that displays debug information directly in the app. This approach is useful when you need to see values in real time.
124
125
125
-
### Step 1: Collect debug data
126
+
### Collect debug data
126
127
127
-
Instead of using Trace, collect data to a local collection:
128
+
Instead of using Trace, add data to a local [collection](/power-apps/maker/canvas-apps/create-update-collection). For example:
128
129
129
130
```powerfx
130
131
If(
@@ -139,11 +140,11 @@ If(
139
140
)
140
141
```
141
142
142
-
### Step 2: Add a text control to display traces
143
+
### Add a text control to display traces
143
144
144
145
Add a text control to the screen that shows the collected traces. Set its **Visible** property so it only appears in debug mode.
@@ -156,7 +157,7 @@ Add a text control to the screen that shows the collected traces. Set its **Visi
156
157
157
158
This displays a scrollable list of debug messages that you can copy and analyze outside the app.
158
159
159
-
### Example YAML for the text control
160
+
####Example YAML for the text control
160
161
161
162
If you're using Power Apps Studio's YAML view:
162
163
@@ -178,20 +179,19 @@ If you're using Power Apps Studio's YAML view:
178
179
```
179
180
180
181
> [!IMPORTANT]
181
-
> Remove or hide the diagnostics panel before deploying the app to end users. Users who open the app with the debug parameter shouldn't see internal diagnostic information.
182
+
> Remove or hide the diagnostics panel before you deploy the app to end users. Users who open the app with the debug parameter shouldn't see internal diagnostic information.
182
183
183
184
## Best practices for alternative debugging
184
185
185
-
- **Guard debug controls**: Use query string parameters (`Param("debug") = "true"`) or role checks to show debug features only during testing.
186
-
- **Clean up before deployment**: Remove debug controls, logging calls, and diagnostic panels before you deploy broadly.
187
-
- **Manage log storage**: For Dataverse or SharePoint logging, periodically delete old entries.
188
-
- **Use meaningful labels**: Include descriptive titles like "BeforeSubmit" or "OnVisible_OrderScreen" to make logs easier to analyze.
189
-
- **Include context**: Log the user email, screen name, and relevant data values so you can correlate entries across sessions.
186
+
Follow these guidelines when using alternative debugging approaches:
187
+
188
+
- *Guard debug controls*: Use query string parameters (`Param("debug") = "true"`) or role checks to display debug features only during testing.
189
+
- *Clean up before deployment*: Remove debug controls, logging calls, and diagnostic panels before you deploy broadly.
190
+
- *Manage log storage*: For Dataverse or SharePoint logging, periodically delete old entries to manage storage.
191
+
- *Use meaningful labels*: Include descriptive titles such as "BeforeSubmit" or "OnVisible_OrderScreen" to make logs easier to analyze.
192
+
- *Include context*: Log the user email, screen name, and relevant data values so you can correlate entries across sessions.
190
193
191
194
## Related content
192
195
193
-
- [Debug canvas apps with Live monitor and Trace](monitor-debugging-canvas-apps.md)
194
-
- [Analyze app telemetry using Application Insights](/power-apps/maker/canvas-apps/application-insights)
195
196
- [Collaborative debugging with Live monitor](/power-apps/maker/monitor-collaborative-debugging)
0 commit comments