Improve Usability with Power Apps Notifications

The Power Apps Notify function allows developers to display banner messages to users, providing feedback as they interact with the app.

Whether you’re confirming a successful action, warning about invalid input, or alerting users to errors, Notify() is a simple and effective tool to improve user experience.

Basic Usage

In a sample Bookstore app, users can insert records using an Edit Form connected to a Dataverse table. Initially, no feedback is shown after saving a record.

To fix this, use the Notify function in the form’s OnSuccess property:

Notify("Book added successfully", NotificationType.Success)

This displays a success message when the form is submitted successfully.

Customizing Duration

You can control how long the message appears by adding a third parameter (in milliseconds):

Notify("Book added successfully", NotificationType.Success, 2000)

This keeps the message visible for 2 seconds.

Handling Errors

To notify users when something goes wrong, use the OnFailure property of the form:

Notify("An error has occurred", NotificationType.Error, 3000)

This displays an error message if the form submission fails.

Informational Messages

You can also show messages before an action begins. For example, in the OnSelect property of a Save button:

Notify("Your record is being saved", NotificationType.Information, 1500)

This informs the user that the save process has started.

Warning Messages Based on Conditions

To validate input and warn users, use conditional logic. For example, to check if the year entered is greater than the current year:

If(Value(DataCardValue4.Text) > Year(Today()),
  Notify("Year is invalid, cannot be greater than current year", NotificationType.Warning, 3000),
  Set(varValid, true) )

Then, check varValid before submitting the form:

If(varValid,
  SubmitForm(EditForm1);
  Set(varValid, false) )

Conclusion

The Notify function in Power Apps is a powerful way to communicate with users. By using different notification types—Success, Error, Information, and Warning—you can guide users through your app and improve their experience with clear, timely feedback.

Comments

Leave a Comment

Your email address will not be published. Required fields are marked *