Portal triggers for Teams notifications

Power Pages (formerly Power Apps Portals) can trigger real-time Microsoft Teams notifications when events happen on the portal. For example:

  • New form submissions (e.g., support requests, registrations)
  • Document uploads
  • User feedback
  • Order or booking confirmations

This guide outlines how to set up automated Teams alerts using Power Automate as a bridge between Power Pages and Teams.


Architecture Overview

Power Pages → Power Automate → Microsoft Teams

  • Trigger: Portal submission (form, file, etc.)
  • Automation: Power Automate receives the trigger and composes a message
  • Action: Flow posts a Teams message to a specified channel or user

Key Components

  • Dataverse Table: Stores portal submission data
  • Power Automate Flow: Automates detection and notification
  • Teams Connector: Posts messages to Teams channels
  • Portal Logic: Optionally uses Web APIs or JavaScript for real-time flow triggering

Step-by-Step Implementation

Step 1: Identify the Portal Event

Common triggers:

  • New record in Dataverse (e.g., SupportRequests)
  • Updated record (e.g., Status = "Resolved")
  • File uploaded (tracked in a custom table)

Ensure your portal form is saving to a Dataverse table.


Step 2: Create the Power Automate Flow

  1. Go to Power Automate
  2. Click CreateAutomated Cloud Flow
  3. Name your flow: “Portal Submission – Notify Teams”
  4. Choose a trigger:
    • When a row is added (Dataverse)
    • Choose your environment and the relevant table (e.g., SupportRequests)
    • Set scope to Organization

Step 3: Compose Teams Message

  1. Add Microsoft Teams action:
    Post a message (V3) to a channel
  2. Configure:
    • Team: Select your Microsoft Teams team
    • Channel: Choose the desired channel (e.g., Support Alerts)
    • Message:
 New Support Request Submitted

Name: @{triggerOutputs()?['body/firstname']}
Email: @{triggerOutputs()?['body/email']}
Message: @{triggerOutputs()?['body/message']}

Submitted on: @{triggerOutputs()?['body/createdon']}
  1. Optionally, add adaptive cards using Post adaptive card in a chat or channel for richer formatting.

Step 4: Add Conditional Logic (Optional)

Add a Condition block:

  • Example: Notify only when priority is high
If Priority = "High"
→ Post to Teams
Else
→ Do nothing or log

Step 5: Test Your Flow

  1. Go to the Power Pages portal
  2. Fill out the form (e.g., new support request)
  3. Submit
  4. Check the Teams channel for notification

Alternative Trigger: HTTP Webhook (Advanced)

If you prefer portal-side logic:

1. Create Power Automate Flow with HTTP Trigger

  • Trigger: When an HTTP request is received
  • Accept parameters like name, email, message

2. Add Teams Action

  • Same as above – post to channel or chat

3. Call from JavaScript in Portal

Add this in a script:

fetch("https://prod-xx.flow.microsoft.com/...", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "John Doe",
email: "john@example.com",
message: "Urgent ticket"
})
});

Use this method for instant triggers without waiting for Dataverse row commits.


Use Cases and Examples

Use CaseTrigger TableTeams Channel
Contact Us formContactSubmissionsMarketing Alerts
Job ApplicationJobApplicationsHR Notifications
High-Priority SupportSupportTicketsSupport Escalations
Document UploadUploadedFilesCompliance

Best Practices

TipReason
Add metadata to messagesEasier for teams to take action
Use adaptive cardsEnables buttons, replies, rich formatting
Monitor flow run historyFor debugging failed triggers
Use environment variablesAvoid hardcoding channel IDs
Secure flow accessUse authentication if calling via HTTP

Security Considerations

  • Avoid exposing flow URLs publicly
  • Secure HTTP-triggered flows using Azure AD or API Management
  • Use role-based access to restrict sensitive data
  • Avoid including PII directly in Teams messages unless encrypted/authorized

Advanced Features (Optional)

  • Mention users in messages: @John Doe
  • Use Post message in chat to alert specific team members
  • Schedule batch alerts (e.g., nightly summaries)
  • Trigger based on Power Pages Web API logic instead of raw table change

Leave a Reply

Your email address will not be published. Required fields are marked *