Display Toast Message And Stop Execution
Audience:
Low-code EngineersSkill Prerequisites:
Actions,HTML,Tokens
Shows a short notification, called a toast, in a small popup, then stops running actions. It's available in forms and listings.
The toast only takes the space it needs. The rest of the page stays visible and usable, and the toast closes by itself after a set time.
| Action | What happens after the toast |
|---|---|
| Display Toast Message And Stop Execution | No further actions run. |
| Display Toast Message And Continue Execution | The toast is shown right away and the next actions keep running. |
Typical Use Cases
- Confirm to the user that their changes were saved, as the last action of a button
- Show a short warning and stop, for example when a search returns no results
- Show a short message that uses tokens, for example
Thanks, [User:FirstName]!
Don't use it to
- Show a message and keep running the next actions. Use Display Toast Message And Continue Execution instead.
- Show a long or important message the user shouldn't miss. Use Display Message or Display Error Message instead.
- Debug. Use Log Debug Message or Log Error instead.
- Stop without showing anything. Use Stop Execution instead.
Related Actions
| Action Name | Description |
|---|---|
| Display Toast Message And Continue Execution | Shows the same toast and keeps running actions. |
| Display Message | Shows a message in place of the form and ends execution. |
| Display Error Message | Shows an error message and ends execution. |
| Execute Javascript Code And Continue Execution | Runs your own JavaScript in the browser, for notifications the toast can't do. |
| Stop Execution | Stops running actions without a message. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Heading | An optional heading, shown in bold above the message. | Yes | empty string | No |
| Message | The text of the toast. It's a rich text editor, so you can use HTML. | Yes | empty string | No |
| Type | The style of the toast: Default, Warning, Success, Error or Info. Default is dark gray with no icon. The others have their own color and an icon on the left. | No | Default | No |
| Background Color | Overrides the background color of the type, for example red, #ff0000 or rgb(255,0,0). Leave it empty to use the color of the type. | Yes | empty string | No |
| Transition | How the toast appears and disappears: Fade, Slide or Plain. | No | Fade | No |
| Allow Toast Close | Shows an × in the top-right corner, so the user can close the toast. | No | false | No |
| Javascript | JavaScript that runs in the browser after the toast disappears, whether it closed by itself or the user closed it. | Yes | empty string | No |
| Hide (with transition^) after (ms) | How long the toast stays on screen, in milliseconds. It then closes with the chosen transition. Must be a whole number. Anything else is treated as 1000. | Yes | 1000 | No |
| Stack Length | The most toasts shown at the same time. When a new toast would go over this number, the oldest ones are removed. 1 shows one toast at a time. | Yes | 1 | No |
| Toast Position | Where the toast appears: Bottom Left, Bottom Right, Bottom Center, Top Right, Top Left, Top Center or Middle Center. | No | Bottom Center | No |
| Text Alignment | How the text is aligned: Left, Right or Center. | No | Left | No |
| Show Loader | Shows a progress bar at the top of the toast that fills up until the toast closes. | No | false | No |
| Loader Color | The color of the progress bar, for example red, #ff0000 or rgb(255,0,0). Only shown when Show Loader is on. Leave it empty for green (#9EC600). | Yes | empty string | No |
Considerations
- Final action. Actions placed after this one in the same list never run, unless its condition is false. To show a toast only in some cases, give it a condition, for example
"[Status]" == "Saved". See Common Parameters. - HTML isn't encoded. The
HeadingandMessageare shown as HTML, including token values. If a token holds text typed by a user, it's shown as HTML too. - There's no "stay open" setting. The toast always closes after
Hide (with transition^) after (ms). For a message the user must read, use a long time withAllow Toast Close, or use Display Message. - The time includes the transition. A fade or slide takes about 400 ms of the display time. Very short times, such as
500, barely show the toast. - Check the
Javascriptcode. Tokens are placed in the code as plain text. A syntax error in the code stops the toast from showing. If the code fails when it runs, the error only appears in the browser console. - Empty values fall back. If a token or expression makes
Stack Lengthempty or not a number, up to5toasts are shown. IfToast Positionis empty, the toast appears at the bottom right.
Examples
tip
To understand how to use the below examples, please see Running Examples.
1. Confirm a save
This action shows a green success toast at the top center for 5 seconds, with a progress bar and a close button. It addresses the logged-in user by name. No further actions run.
{
"Title": "Display Toast Message And Stop Execution",
"ActionType": "ShowToast",
"Description": "Confirm the save to the user",
"Parameters": {
"Heading": "Saved",
"Message": "<p>Thanks, [User:FirstName]. Your changes have been saved.</p>",
"Icon": {
"Expression": "",
"Value": "success",
"IsExpression": false,
"Parameters": {}
},
"BgColor": "",
"Transition": {
"Expression": "",
"Value": "fade",
"IsExpression": false,
"Parameters": {}
},
"AllowToastClose": true,
"CallBackJsCode": "",
"HideTime": "5000",
"Stack": "1",
"ToastPosition": {
"Expression": "",
"Value": "top-center",
"IsExpression": false,
"Parameters": {}
},
"TextAlignment": {
"Expression": "",
"Value": "left",
"IsExpression": false,
"Parameters": {}
},
"ShowLoader": true,
"LoaderColor": "#ffffff"
}
}
2. Warn when there's nothing to process
This action shows a warning toast and stops when the ItemCount token is 0. Otherwise the next actions run.
{
"Title": "Display Toast Message And Stop Execution",
"ActionType": "ShowToast",
"Description": "Nothing selected",
"Condition": "\"[ItemCount]\" == \"0\"",
"Parameters": {
"Heading": "Nothing to process",
"Message": "<p>Select at least one item and try again.</p>",
"Icon": {
"Expression": "",
"Value": "warning",
"IsExpression": false,
"Parameters": {}
},
"Transition": {
"Expression": "",
"Value": "slide",
"IsExpression": false,
"Parameters": {}
},
"AllowToastClose": true,
"HideTime": "4000",
"Stack": "1",
"ToastPosition": {
"Expression": "",
"Value": "bottom-center",
"IsExpression": false,
"Parameters": {}
},
"TextAlignment": {
"Expression": "",
"Value": "left",
"IsExpression": false,
"Parameters": {}
},
"ShowLoader": false
}
}
Revised 09/27/2026