Show a notification message with "Run script" mode for Action (Retool)

1.4k Views Asked by At

With "Show notification" mode for Action and other settings as shown below, I could show a notification message on the top right corner of the screen:

enter image description here

This is the notification message on the top right corner of the screen:

enter image description here

Now, with "Run script" mode for Action as shown below, I want the same notification message as shown above:

enter image description here

Are there any ways to do that?

1

There are 1 best solutions below

0
Super Kai - Kazuya Ito On

You can use "utils.showNotification()" function with one object which contains 4 values "title", "description", "notificationType" and "duration".

utils.showNotification({ 
  title: "something", 
  description: "something", 
  notificationType: "info", // "info", "success", "warning" or "error" is available
  duration: 5 // If "duration" isn't set, 4.5 is set. 
});

This is the code to show the same notification message with "Run script" mode for Action:

utils.showNotification({ 
  title: "This is title.", 
  description: "This is description", 
  notificationType: "info", 
  duration: 5 
});

enter image description here

Then, you can show the same notification message with "Run script" mode for Action:

enter image description here