App Session Trend Analyzer
Weekly scheduled flow reads app session telemetry from Dataverse, computes 30-day rolling average sessions per app, compares to prior period, and flags apps with >50% session decline.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
The App Session Trend Analyzer is a weekly scheduled Power Automate Cloud Flow that monitors canvas app adoption health across a Power Platform tenant. It reads app session telemetry from a Dataverse table, computes a 30-day rolling session count for the current and prior periods, calculates the percentage change, and flags any significant decline. When sessions drop by more than the configurable threshold (default 50%), it sends a high-importance alert email to the COE admin. When sessions are healthy, it sends a normal-priority summary report.
Use Case
Center of Excellence (COE) teams need early warning when apps are losing adoption. A sustained session decline often signals an app heading toward abandonment — catching it early allows the COE to reach out to users, investigate UX issues, or plan retirement before the app becomes fully orphaned.
Flow Architecture
Weekly Recurrence
RecurrenceFires every Monday at 8:00 AM UTC.
Init varDataverseOrgUrl
Initialize VariableReads the `flowlibs_DataverseOrgUrl` environment variable.
Init varAdminEmail
Initialize VariableReads the `flowlibs_AdminEmail` environment variable.
Init varAppTelemetryTableName
Initialize VariableReads the `flowlibs_AppTelemetryTableName` environment variable.
Init varDeclineThresholdPct
Initialize VariableConfigurable percentage threshold for triggering an alert (default 50).
Init varReportDate
Initialize VariableCurrent UTC date used for report labeling.
Init varHtmlRows
Initialize VariableAccumulator string variable for the HTML table rows.
Init varDecliningAppCount
Initialize VariableInteger counter for the number of declining apps.
List Current Period App Sessions
Dataverse ListRecordsQueries the telemetry table for the last 30 days of session records.
List Prior Period App Sessions
Dataverse ListRecordsQueries the telemetry table for session records 30–60 days ago.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_DataverseOrgUrl | String | <configure> | Target Dataverse environment URL (for example https://your-org.api.crm.dynamics.com). |
| flowlibs_AdminEmail | String | you@yourcompany.com | Recipient address for trend report and alert emails. |
| flowlibs_AppTelemetryTableName | String | msdyn_componentlayerdatasource | Dataverse table that stores app session telemetry data. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords (queries current and prior period app session telemetry) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (sends the trend report or decline alert email) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Deploy in a new environment
- Import the managed solution into the target environment, update the three environment variable current values for your tenant, authorize the Microsoft Dataverse and Office 365 Outlook connections, then turn the flow On.
- Adjust alert sensitivity
- Change the varDeclineThresholdPct variable default value inside the flow. Lower values (e.g. 25) will trigger alerts on smaller declines; higher values (e.g. 75) only flag severe drops.
- Change the schedule
- Edit the Weekly Recurrence trigger to adjust the day, time, or frequency the analysis runs.
- Add per-app breakdown
- Extend the Select actions to group by app name, then use an Apply to Each loop to build individual rows in the HTML report table for each app.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Date filter — current period
OData filter passed to the current-period Dataverse ListRecords action.
EXPR.02Date filter — prior period
OData filter passed to the prior-period Dataverse ListRecords action.
EXPR.03Decline calculation
Computes the percentage decline between prior and current period session counts; guards against divide-by-zero.
EXPR.04Significant-decline condition
Used in the If condition to decide whether to send the alert or healthy email branch.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.