Build in-app notification for model driven apps
For this week, I want to explore the possibility of building in-app notification for a model driven app.
But how?
We don't need to write some fancy code to do this but rather use XrmToolBox (Home?· XrmToolBox). This is a prerequisite to use the In-App notification builder tool. You can install this tool from the tool library in XrmToolBox.
Now that you have the tool installed, it is important to configure connection to your environment.
Once you have connected to your environment, we can go ahead and open the in-app notification tool. And from the app drop down we can select the app where we want to implement notification.
I want to implement the notification for Asset management app in the current environment. As we haven't created any notification before this app, we see a red button next to the 'Notification Status'.
We are going to go ahead and click the red button to enable the in-app notification for this app.
And what now?
Now let's start building the custom notification. Within the data tab you can change a lot of things like the title and body of the notification. You can also add hyperlinks/images to the body.
With the toast type we can either select timed or hidden, the first being a pop-up notification and the latter being a hidden notification.
On the right side, you see the preview of your in-app notification button. Here I want it as an info notification, but you can also change it to failure/success/warning or even add a custom icon (web resource) for your own custom notification.
After filling in the data tab, we now move on to the action tab. I go ahead create a new action type for Record.
Here you see that the id is weird it only has 0s. But you want the id to be dynamic based on the record that you have created. And this is where the magic happens. Once you are satisfied with your actions. Let us go and hit the get code button. We select the option of Power Automate as we want to use it in a flow and get dynamic values of the record (id).
领英推荐
Let's make a flow now and use the get code snippets in that. I want to trigger a flow when a new record is created in the asset table.
And to enable the in-app notification, I am going to add the action "add a new row" and use the notifications table. And when you click the advanced options in the action, you notice that some of the fields are the same as the get code button. So, go ahead and copy the values from XrmToolBox to the respective fields in Power Automate.
As I mentioned earlier, we want to add context to the notification. So, we go ahead and replace the highlighted value with dynamic content (guid) from the previous step.
Let's Test it
I will go ahead and create a new asset.
And once I hit the save button, we are going to trigger the flow, and it seems like the flow run was a success.
And voila! We got out in-app notification.
Because we have attached the guid of the asset we can go ahead and click the "A new Asset" button, and this should open the related record.
That is super cool.
Powerbouwer | Microsoft Business Applications MVP | PowerAddictsNL | Power Platform Challenge
2 年Nice stuff mate! Keeep up the good work ??