Skip to content

Notification Functions (notification.(type))

The scripting environment provides functions to display different types of notifications to the user interface. These can be used to inform the user about the status of a script operation, highlight important information, or signal errors.

The available notification functions are:
- notification.info()
- notification.success()
- notification.warning()
- notification.error()

While each function displays a different style of notification (distinguished by color and icon), they all share the same syntax and parameters.

Syntax

notification.info(title, message);
notification.success(title, message);
notification.warning(title, message);
notification.error(title, message);

Parameters

All notification functions (info, success, error) take the following parameters:

Parameter Type Required Description
title String Yes The title of the notification.
message String Yes The main content or body of the notification.

Return value

These functions perform a user interface action and do not return any value.

The user interface and interaction are depended on the type. All notifications can be clicked to be removed. Although info, success, and warning notifications will disappear automatically. The error notification will remain in view until it’s clicked.

Examples

Example: Information Notification (notification.info)

This example shows how to display a general information notification:

notification.info('Process Started', 'The data import process has begun.');
Info notification

Example: Success Notification (notification.success)

This example shows how to display a success notification:

notification.success('Operation Complete', 'User data was successfully updated.');
Success notification

Example: Warning Notification (notification.warning)

This example shows how to display a warning notification:

notification.warning('Operation reset', 'User data was not updated correctly.');
Warning notification

Example: Error Notification (notification.error)

This example shows how to display an error notification:

notification.error('Save Failed', 'Could not save the document. Please check your input.');
Error notification