With the new features of Model Driven Apps in Dynamics 365, the user can now get fancy in-app notifications. The users will see a notification pop-up in their apps based on the condition they want(creating a record, updating a field, deleting a record etc. basically anything you want) and this notifications can also lead users to the records.




This is a preview feature and you need to enable it from developer console of your browser. Don’t worry, it is some very easy steps.
Open your environment, then open your app where you want to enable this feature. Click on the F12 key to open the developer console. Paste this below code to your console and hit enter to execute it.
fetch(window.origin + "/api/data/v9.1/SaveSettingValue()", {
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
AppUniqueName: "msdynce_saleshub",
SettingName: "AllowNotificationsEarlyAccess",
Value: "true"
})
});
You can find the unique app name by opening the app designer and clicking on the properties tab as shown in the image below.

When you publish your app, you should be able to see a bell icon on top right of the app as shown in the below image.

To send a notification, you will create a record in the “appnotification” table/entity. Since this is a basic record creating, createRecord API, Web API and Power Automate Flow all are suitable for this.
If you are using Power Automate Flow, you will add a new row to the Notifications table like the image below.

Or you can use the createRecord API to send a notification.
var systemuserid = "Guid of the user";
var notificationRecord =
{
"title": "Welcome",
"body": "Welcome to the world of app notifications!",
"ownerid@odata.bind": "/systemusers(" + systemuserid + ")",
"icontype": 100000000, // info
"toasttype": 200000000 // timed
}
// Create notification record
Xrm.WebApi.createRecord("appnotification", notificationRecord).
then(
function success(result) {
console.log("notification created with ID: " + result.id);
},
function (error) {
console.log(error.message);
// handle error conditions
}
);

Column | Description |
Title | The title of the notification. |
Owner | The user who receives the notification. |
Body | Details about the notification. |
Icon Type | The list of predefined icons. The default value is Info . For more information, go to Changing the notification icon later in this topic. |
Toast Type | The list of notification behaviors. The default value is Timed . For more information, go to Changing the notification behavior later in this topic. |
Expiry (seconds) | The number of seconds from when the notification should be deleted if not already dismissed. |
Data | JSON that’s used for extensibility and parsing richer data into the notification. The maximum length is 5,000 characters. |
Icon Type | Value |
Info | 100000000 |
Success | 100000001 |
Failure | 100000002 |
Mention | 100000003 |
Warning | 100000004 |
Custom | 100000005 |
For more info, check the official docs link: https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/send-in-app-notifications#send-basic-in-app-notifications-by-using-the-web-api?WT.mc_id=BA-MVP-5003699