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-debugging-canvas-apps.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ search.audienceType:
13
13
14
14
## Summary
15
15
16
-
This article explains how to use [Live monitor](/power-apps/maker/monitor-overview) with the [Trace function](/power-platform/power-fx/reference/function-trace) to diagnose issues in Power Apps canvas apps. This approach helps you troubleshoot problems that appear only for certain users or in specific environments. Live monitor shows real-time events like network calls, data operations, errors, and performance details. The Trace function lets you add custom diagnostic records to capture values from [behavior formulas](/power-apps/maker/canvas-apps/working-with-formulas#manage-app-behavior) at key moments.
16
+
This article explains how to use [Live monitor](/power-apps/maker/monitor-overview) with the [Trace function](/power-platform/power-fx/reference/function-trace) to diagnose issues in Power Apps canvas apps. This approach helps you troubleshoot problems that occur only for certain users or in specific environments. Live monitor displays real-time events such as network calls, data operations, errors, and performance details. The Trace function lets you add custom diagnostic records to capture values from [behavior formulas](/power-apps/maker/canvas-apps/working-with-formulas#manage-app-behavior) at key moments.
17
17
18
18
> [!NOTE]
19
19
> If you can't use Live monitor (for example, in SharePoint forms or custom portal embeddings), see [Debug canvas apps without Live monitor](monitor-debugging-canvas-apps-without-live-monitor.md) for alternative approaches.
@@ -24,34 +24,34 @@ This article builds on [Debugging canvas apps with Live monitor](/power-apps/mak
24
24
25
25
## Combine Live monitor and Trace
26
26
27
-
Live monitor shows platform-level activity: data operations (`getRows`, `createRow`, `patch`), control evaluations, errors (HTTP status codes like`404` or `429`), timing, and delegation indicators.
27
+
Live monitor displays platform-level activity: data operations (`getRows`, `createRow`, `patch`), control evaluations, errors (HTTP status codes such as`404` or `429`), timing, and delegation indicators.
28
28
29
-
By adding Trace calls in your behavior formulas (`OnSelect`, `OnVisible`, `OnStart`), you add context like:
29
+
When you add Trace calls in your behavior formulas (`OnSelect`, `OnVisible`, `OnStart`), you capture context such as:
30
30
31
-
-Which user is running the app
32
-
-Which environment the app is running in
33
-
-Which screen is active
31
+
-The user running the app
32
+
-The current environment
33
+
-The active screen
34
34
- Entity counts (rows in collections, related records)
35
35
- Business flags (VIP status, discount eligibility)
36
36
- Elapsed times for operations
37
-
- Any other information that helps you understand what the app is doing
37
+
- Any other information that helps you understand app behavior
38
38
39
39
Together, Live monitor and Trace answer both "what happened" and "why."
40
40
41
41
### View data flowing over the network
42
42
43
-
Live monitor shows each data operation event with:
43
+
Live monitor displays each data operation event with:
44
44
45
45
- Operation type (`getRows`, `createRow`, `patch`, `removeRow`)
46
46
- Data source (Dataverse table or connector name)
47
47
- Timing (start, finish, duration)
48
48
- Result (success or error status code)
49
-
- Delegation hints (non-delegable operations cause client-side processing)
Select an event to see details. Correlate events with nearby Trace records to understand *why* the operation occurred. For example, a `getRows`surge after a Trace with `phase: "ApplyFilters"` might indicate an inefficient filter expression.
51
+
Select an event to view details. Correlate events with nearby Trace records to understand *why* the operation occurred. For example, a surge in `getRows`calls after a Trace with `phase: "ApplyFilters"` might indicate an inefficient filter expression.
52
52
53
53
> [!TIP]
54
-
> If you see HTTP 429 (throttling), look at preceding events to see whether a loop or repeated evaluation triggered excessive operations. Optimize formulas or use collections to cache data and reduce network calls.
54
+
> If you see HTTP 429 (throttling), check preceding events to determine whether a loop or repeated evaluation triggered excessive operations. Optimize formulas or use collections to cache data and reduce network calls.
55
55
56
56
### Use Trace effectively
57
57
@@ -60,13 +60,13 @@ The [Trace function](/power-platform/power-fx/reference/function-trace) writes a
60
60
Key features:
61
61
62
62
- Works only in behavior properties (`OnSelect`, `OnChange`, `OnVisible`, `OnStart`).
63
-
- Accepts text and a record payload for additional details.
64
-
-`TraceSeverity` helps filter events (Information, Warning, Error). Use Error sparingly.
65
-
- Has minimal performance impact when used appropriately. Remove or guard verbose traces before broad deployment.
63
+
- Accepts a text message and an optional record payload for additional details.
64
+
-`TraceSeverity` helps you filter events (Information, Warning, Error). Use Error sparingly.
65
+
- Has minimal performance impact when used appropriately. Remove or guard verbose Trace calls before broad deployment.
66
66
67
67
#### Trace data property values with debug buttons
68
68
69
-
Because Trace can't be placed in data properties (like a label's `Text`), use temporary debug buttons to capture those values.
69
+
Because you can't place Trace in data properties (such as a label's `Text`), use temporary debug buttons to capture those values.
70
70
71
71
To create a debug button:
72
72
@@ -75,7 +75,7 @@ To create a debug button:
75
75
1. When testing, add `&debug=true` to the app URL to show the button.
76
76
77
77
> [!TIP]
78
-
> It's also useful to trace the values used to calculate a data property, as they might indicate why the value isn't what you expect.
78
+
> Trace the input values used to calculate a data property. They often reveal why the result isn't what you expect.
79
79
80
80
##### Example debug snapshot button
81
81
@@ -97,7 +97,7 @@ Trace(
97
97
```
98
98
99
99
> [!NOTE]
100
-
> Guard debug controls with query string parameters or role checks so end users don't see them. Remove these controls before you finalize the app.
100
+
> Guard debug controls with query string parameters or role checks so that end users don't see them. Remove these controls before you finalize the app.
101
101
102
102
### Debugging checklist
103
103
@@ -131,7 +131,7 @@ Capture what the app sees about each user (email, roles, customer selection, dis
131
131
1. Open a new Live monitor instance and connect User B the same way.
132
132
1. Compare the values to find the difference causing the problem.
133
133
134
-
#### Example: OnSelect formula with Trace
134
+
#### Example OnSelect formula with Trace
135
135
136
136
```powerfx
137
137
// Emit pre-submit context
@@ -180,11 +180,11 @@ Correlate Trace events with adjacent `getRows` or `patch` operations. If User B
180
180
181
181
### Scenario: App works in one environment but not another
182
182
183
-
Your app works correctly in _Test_ but fails in _Production_, for example a gallery loads no items and submission is slow. Even though the app is the same, the data in each environment can differ, this difference can cause the app to experience problems in one environment but not the other.
183
+
Your app works correctly in *Test* but fails in *Production*. For example, a gallery loads no items and submission is slow. Even though the app is the same, the data in each environment can differ. Missing tables, different column values, larger datasets that trigger delegation limits, or permission differences can cause the app to behave differently.
184
184
185
185
#### Goal
186
186
187
-
Surface environment-specific metadata and counts, then compare the sequence and status codes of data operations between environments. In this example, the app has one screen with a form where a **Product** selected from a gallery can be updated. The update works in _Test_ but fails in _Production_.
187
+
Surface environment-specific metadata and counts, then compare the sequence and status codes of data operations between environments. In this example, the app has one screen with a form where a **Product** selected from a gallery can be updated. The update works in *Test* but fails in *Production*.
188
188
189
189
#### Steps
190
190
@@ -203,19 +203,19 @@ Surface environment-specific metadata and counts, then compare the sequence and
203
203
```
204
204
205
205
1. Deploy the app with the new traces to production.
206
-
1. Open Live monitor in _Test_ and then in _Production_. Export logs if needed.
206
+
1. Open Live monitor in *Test* and then in *Production*. Export logs if needed.
207
207
208
208
#### Analyze the results
209
209
210
210
In the event list:
211
211
212
-
- Compare `getRows` for **Products** across environments. Does one return zero results or error codes (`404` if the table is missing, `403` if access is denied, `429` if throttled)?
213
-
- Look for repeated `getRows` calls that might indicate a non-delegable formula.
212
+
- Compare `getRows` events for **Products** across environments. Does one return zero results or error codes (`404` if the table is missing, `403` if access is denied, `429` if throttled)?
213
+
- Look for repeated `getRows` calls, which might indicate a non-delegable formula.
214
214
- Compare the Trace values. Do products have different values for `relatedOrders` or `hasDiscount`?
215
215
216
-
If you find a difference, add more Trace calls where the variable is created to see how it's populated.
216
+
If you find a difference, add more Trace calls where the variable is set to see how it's populated.
217
217
218
-
If you see network errors (`4xx` responses), check whether tables, flows, and connectors are set up correctly in both environments.
218
+
If you see network errors (`4xx` responses), verify that tables, flows, and connectors are configured correctly in both environments.
0 commit comments