CRM Crate

Display the notifications in Canvas App using Notify() function?

We will learn display the notifications in Canvas App using Power FX Notify() function. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field of Power Platform.

notifications in Canvas App

What is Power FX?

Microsoft’s Power Fx is the low-code language that will be used across Power Platform. It’s a strong-typed, general-purpose, declarative, and functional programming language. Power Fx is expressed in user-friendly text. It’s a low-code language that citizen developers & makers can work with directly in an Excel-like formula bar or Visual Studio Code text window.

It enables a complete range of development from no-code for those who have never programmed before to “pro-code” for the seasoned professional, with no learning or rewriting cliffs in between, enabling diverse teams to collaborate and save time and expense.


Understanding Notify function

Notify(Message [,NotificationType, Timeout]])

The Notify function displays a banner message to the user at the top of the screen, overlaying what is currently displayed. The notification will remain until the user dismisses it, another notification replaces it, or the timeout expires which defaults to 10 seconds.
Message – Required. Message to display to the user.
NotificationType – Optional. Type of the message to display from the table above. The default is NotificationType.Information.
Timeout – Optional. Number of milliseconds to wait before automatically dismissing the notification. The default is 10 seconds (or 10,000 milliseconds). The notification will be displayed indefinitely with a Timeout of  0.

Type of Notifications

Canvas App support four different type of notifications as given below.

NotificationType ArgumentDescription
NotificationType.ErrorCanvas App displays the message as an error.
NotificationType.Information (Default)Canvas App displays the message as informational.
NotificationType.SuccessCanvas App displays the message as success.
NotificationType.WarningCanvas App displays the message as a warning.

Examples of Notify Power FX function

Notify( “CRM Crate Error Notification”, NotificationType.Error, 1000)

The above Power FX formula displays an error notification for 1 second.

Notify( “CRM Crate Information Notification”, NotificationType.Information, 1000)

The above Power FX formula displays an informative notification for 1 second.

Notify( “CRM Crate Success Notification”, NotificationType.Success, 1000)

The above Power FX formula displays a success notification for 1 second.

Notify( “CRM Crate Warning Notification”, NotificationType.Warning, 1000 )

The above Power FX formula displays a warning notification for 1 second.

Validating our implementation in Canvas App

The below animation display an output of Notify function in Canvas App.

Thus, we learned to display the notifications in Canvas App / Power App?


4 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
error: CRM Crate Security Engine - Disabled Right Click & Selection!

Congratulations!

Well Done,
Welcome to CRM Crate

Stay tuned with us and get all latest updates and learning in Microsoft CRM and related techonologes.