Design a site like this with WordPress.com
Get started

Enable App Notifications on Org level rather than App level

This happened by mistake, but a mistake that was really beneficial !

Recently Microsoft reveled a new feature for early access but in order to use this feature you needed to run an API for an APP level

The code given by Microsoft was –

fetch(window.origin + “/api/data/v9.1/SaveSettingValue()”,{
method: “POST”,
headers: {‘Content-Type’: ‘application/json’},
body: JSON.stringify({AppUniqueName: “Your app unique name”, SettingName:”AllowNotificationsEarlyAccess”, Value: “true”})
});

https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/send-in-app-notifications#enable-in-app-notification-feature

If you struggled like me to find the exact app name #Don’t_Be_A_Karan then the next paragraph might help you a lot !

Removing the ” Unique App Name ” from the query enabled the feature on an org level !

your new code would look something like

fetch(window.origin + “/api/data/v9.1/SaveSettingValue()”,{
method: “POST”,
headers: {‘Content-Type’: ‘application/json’},
body: JSON.stringify(SettingName:”AllowNotificationsEarlyAccess”, Value: “true”})
});

The results – ALL apps get the notification icon !

In certain cases you would want to enable this on an org level rather than an app level. ( This was not mentioned in MS documentation )

Now if you are like me and went straight to the UI and tried creating a Notification record you would hit an error 9 out of 10 times

And going to power automate creates a record with a GUID but there is a Partition ID that creates an Issue

[ UPDATED After Microsoft helped me rectify this issue Click here to find the resolution to the above issue ]

if you want to try it out you can use your console of your browser –

fetch(window.origin + “/api/data/v9.0/appnotifications”,{
method: “POST”,
headers: {‘Content-Type’: ‘application/json’},
body: JSON.stringify({
“title”: “API”,
“body”: “API!”,
“ownerid@odata.bind”: “/systemusers(GUID of your user )”,
“icontype”: 100000000, // info
“toasttype”: 200000000 // timed
})
});


In case you want to disable this feature its really simple, you can use the below code in the console and perform a hard refresh !

fetch(window.origin + “/api/data/v9.1/SaveSettingValue()”,{
method: “POST”,
headers: {‘Content-Type’: ‘application/json’},
body: JSON.stringify(SettingName:”AllowNotificationsEarlyAccess”, Value: “false”})
});

I hope this helps πŸ˜€!

[FIX to the Power Automate Issue !! Thank you so much Abhishek and Adrian from Microsoft !! ]

Removing the time duration in expiry and linking the owner field to Systemusers(<unique GUID of the user >) allows the system to create notifications flawlessly !

Make sure if you are adding a duration to the expiry, add a good amount of time, something like 5-6 seconds may not work !

I hope this helps ! πŸ˜€

Advertisement

One thought on “Enable App Notifications on Org level rather than App level

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: