You can use Power Automate to dynamically send alerts or notifications to users in Power Pages (Portals) based on triggers such as form submissions, status updates, or record changes in Dataverse.
Common Alert Scenarios
- Form submitted (e.g., support ticket, job application)
- Status changes (e.g., loan approved, registration rejected)
- Scheduled reminders or deadlines
- Manual admin-triggered alerts
High-Level Flow
- Trigger: A Power Automate flow is triggered (manually or automatically) via:
- Dataverse record change (Create, Update)
- Portal form submission
- Scheduled recurrence
- Compose Message: Use dynamic content to format the alert (title, body, link, etc.).
- Create a Notification Record: Insert a record in a custom Alerts table or use a custom web notification entity.
- Display in Portal: Use Liquid or Web Template logic to read the latest alerts for the logged-in user and display them.
Steps to Implement
1. Create Custom “Portal Alerts” Table (Dataverse)
- Fields: Title, Message, Contact (Lookup), IsRead (Boolean), Created On
2. Build Power Automate Flow
- Trigger: When a record is created/modified
- Actions:
- Condition logic (e.g., if Status = Approved)
- Create a record in “Portal Alerts” with:
- Contact (portal user)
- Message (e.g., “Your application has been approved!”)
3. Surface Alerts in Power Pages
- Add a Web Template or Section on the homepage like this:
{% assign user = user.id %}
{% assign alerts = entities.portalalert | where: "contact.id", user | sort: "createdon", "desc" %}
<ul>
{% for alert in alerts %}
<li>{{ alert.title }} - {{ alert.message }}</li>
{% endfor %}
</ul>
Bonus Ideas
- Mark alerts as “read” when viewed.
- Add Toastr or SweetAlert popups for real-time alert effect.
- Create a notification bell icon with unread count.
Security Tips
- Make sure table permissions are set up to allow the logged-in user to read only their own alerts.
- Use contact ownership-based permissions to enforce visibility.
Summary
Power Automate lets you:
- Automatically push alerts to portal users
- Drive engagement through status updates and reminders
- Fully integrate backend logic with real-time communication