Escalated Case Alert to Teams Channel
Polls Salesforce every 15 minutes for high-priority or escalated cases and posts a formatted alert to a dedicated Teams support channel with case number, subject, account name, and owner.
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
This flow monitors Salesforce for high-priority and escalated support cases on a recurring schedule, then posts formatted alert cards to a designated Microsoft Teams channel. It enables support teams to stay on top of critical cases without constantly checking Salesforce.
Use Case
Support operations teams need real-time visibility into escalated cases. Rather than relying on reps to manually flag critical issues, this flow automatically polls Salesforce every 15 minutes, identifies cases matching the configured priority threshold or escalation flag, and pushes a rich alert into a Teams support channel with all the key details.
Flow Architecture
Recurrence - Poll Every 15 Minutes
RecurrenceScheduled trigger fires every 15 minutes (configurable via environment variable).
Initialize varTeamsGroupId
Initialize variableLoads the Teams Group ID from the flowlibs_TeamsGroupId environment variable.
Initialize varTeamsChannelId
Initialize variableLoads the Teams Channel ID from the flowlibs_TeamsChannelId environment variable.
Initialize varEscalatedPriority
Initialize variableLoads the priority filter value from the flowlibs_EscalatedCasePriority environment variable (default: "High").
Get Escalated Cases from Salesforce
Salesforce - Get items (table_case)Calls GetItems_table_case on the Salesforce connector with an OData filter: Priority eq '{varEscalatedPriority}' or IsEscalated eq true, ordered by CreatedDate desc, top 50 results.
For Each Escalated Case
Apply to eachIterates over the returned case records and runs the post-to-Teams action for each one.
Post Case Alert to Teams Channel
Microsoft Teams - Post message in a chat or channelFor each case, posts an HTML-formatted message to the configured Teams channel including: Case Number, Subject, Priority, Account Name, Owner Name, Status, Created Date, and Description.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TeamsGroupId | String | <configure> | The Microsoft 365 Group ID for the Teams team where alerts will be posted. Set to the GUID of your target Teams team. |
| flowlibs_TeamsChannelId | String | <configure> | The channel ID within the Teams team where alert messages are posted. |
| flowlibs_CasePollingIntervalMinutes | String | 15 | How often the flow polls Salesforce (used for documentation; the trigger recurrence is set separately on the Recurrence trigger). |
| flowlibs_EscalatedCasePriority | String | High | The Salesforce case Priority value to filter on. Adjust if your Salesforce org uses different priority labels. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Salesforce | shared_salesforce | GetItems_table_case (Retrieves escalated case records) |
| Microsoft Teams | shared_teams | PostMessageToChannelV3 (Posts alert messages to channel) |
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.
- Import the solution
- Import FlowLibsEscalatedCaseAlertDemo into your target environment.
- Update environment variables
- Set flowlibs_TeamsGroupId and flowlibs_TeamsChannelId to your target Teams team/channel. Adjust flowlibs_EscalatedCasePriority if your Salesforce org uses different priority labels.
- Authorize connections
- Open each connection reference and sign in with appropriate credentials for Salesforce and Microsoft Teams.
- Adjust polling frequency
- Edit the Recurrence trigger interval if 15 minutes is too frequent or infrequent for your use case.
- Customize the filter
- Modify the $filter parameter on the Salesforce action to match your case escalation criteria (e.g., add status filters, date range filters).
- Turn on the flow
- Set the flow state to On once connections are authorized and environment variables are configured.
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.01Salesforce escalated case filter
OData filter passed to the Salesforce Get items action; matches cases at the configured priority OR cases flagged as escalated.
EXPR.02Teams message dynamic token (case number)
Pattern for pulling per-iteration case fields into the HTML message body; repeated for Subject, Priority, Account Name, Owner Name, Status, Created Date, and Description.
EXPR.03Environment variable reference pattern
Used inside the Initialize Variable actions to read the env var value; downstream steps then reference @variables('varTeamsGroupId').
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.