# How do administrators configure Custom Notifications to alert users via automated Flow actions?

**Topic:** Admin · **Difficulty:** Medium · **Tags:** Admin, Custom Notifications, In-App Alerts

Read it on the site: https://www.forcechallenges.com/interview-questions/how-do-administrators-configure-custom-notifications-to-alert-users-via-automated-flow-actions

## Answer

**Basics:** Custom notifications appear in the bell icon in Lightning Experience and as push alerts in the Salesforce mobile app. They are for telling people something needs attention (a high-priority case escalated, an approval waiting) without relying on email.

**How it works:**
1. Setup > Notification Builder > Custom Notifications > New. Name it and tick the channels: Desktop (Lightning Experience bell) and/or Mobile (push).
2. In Flow Builder add an Action element and choose "Send Custom Notification".
3. Fill the inputs: Custom Notification Type ID (look it up with a Get Records on CustomNotificationType by DeveloperName), Recipient IDs (a collection of user IDs, or a single group, queue or owner ID), Notification Title, Notification Body, and a Target (Target Record ID or a page reference).
4. Optionally add a Sender ID.
5. Place it in a record-triggered, scheduled or screen flow.

**Advanced / deep dive:** Recipients can be users, public groups, queues, or a record's owner, and flow logic can build a collection with Assignment elements. Clicking the notification navigates to the target record or page. Notifications are delivered per recipient, so avoid sending them to huge audiences in a loop (limits apply, verify the current hourly org limit in documentation). Apex gives the same capability for bulk or complex logic. Notifications do not replace email for audit or reliability since users can disable them, and Classic does not show them. Use a Notification Type per business scenario so users can control preferences and so you can report on usage.

**Code / config example:**
```apex
// Bulk-safe send: one notification to a set of recipients
CustomNotificationType nt = [SELECT Id FROM CustomNotificationType
                             WHERE DeveloperName = 'Case_Escalated' LIMIT 1];
Messaging.CustomNotification n = new Messaging.CustomNotification();
n.setNotificationTypeId(nt.Id);
n.setTitle('Case escalated');
n.setBody('Case ' + c.CaseNumber + ' needs review');
n.setTargetId(c.Id);
n.send(new Set<String>{ c.OwnerId });   // throws on failure, wrap in try/catch
```

**Hidden gotchas & must-remember points:**
- Process Builder could do this too, but Process Builder is retired in favor of Flow; build new alerts in Flow.
- Only one of Target Record ID or Target Page Reference is used; a bad page reference silently opens nothing useful.
- Recipient must have access to the target record or the click leads to an insufficient access error.
- The notification type ID is org-specific, so never hardcode it; query by DeveloperName.
- Notification Type DeveloperName deploys as metadata (CustomNotificationType), but users' delivery preferences do not.
- Desktop notifications appear only in Lightning Experience, and mobile requires the Salesforce mobile app with push enabled.

**Best practice:** Use one clearly named notification type per scenario, send to the smallest relevant audience, and back up critical alerts with email or a task.

---
Source: ForceChallenges · last updated 2026-11-02
