Site icon UnofficialSF

Show Toast – Flow Action

This Post was most recently updated on: 10/3/21

Show Toast – Flow Action

Installation – Install in Production

Sandbox – Install in a Sandbox

Source Code – Source code repository

Enhanced by Eric Smith – December 2019 (Version 2.0)

Version 1.1 only supported specifying the type of Toast (Info, Success, Error, Warning) and the message.

Version 2.0 adds the ability to include a clickable link in the message, add a title, add a custom icon, control the duration of the toast message and select the display mode (Dismissible, Pester & Sticky).

This local action will pop up a toast message.

IMPORTANT! This action will only work in Flows executing in Lightning pages. It will not work if run from Flow Setup (including the Debugger), even if you are in Lightning Experience mode. It will not work if run in a VF page in Classic. This is due to a limitation of the underlying event. For more information, see this documentation

NOTE: Check out these links for how you can use a different component to initiate a Toast message from a Platform Event.

https://github.com/rahulmalhotra/Platform-Event-Toast-LWC/releases/tag/v1.1

You Tube Video

How It Works

This action uses the force:showToast event

It takes multiple attributes. You can control the message, display type and mode, duration and even include a clickable link in the message.

Using the Component

You can use this Lightning Component in a Flow to configure and display a Toast message.

Parameters

(Required)

(Optional)


Sample Usage

This first example shows how a Toast Message can be activated with just a message and defaults.



This example generates a Warning message with a Title, 15 second duration and no close button.


This example generates a Toast Message with a Custom Icon and will be displayed until the close button is clicked.


This last example includes a Link to a newly created record from the Flow.

{!vContactId} holds the record ID of the new Contact
In the message, {url} will be replaced with a Link defined by URL Label and URL Link
This is the URL Label
This is the URL Link

fContactRecordURL is a special formula you can use to combine the correct URL with the currently running domain name and the recordId you want to display.

LEFT({!$Api.Partner_Server_URL_340},FIND("/services", {!$Api.Partner_Server_URL_340})) & {!vContactId} 

Resources

Want to suggest an improvement or report a bug? Do that here

Learn more about how Flow Components work

Know a little javascript and want to add some improvements? {Pull requests are welcome}(/pulls) If you’re thinking of adding much complexity to the user interface, though, you probably should fork the repo, because we want to keep this baseline version easy-to-use.

Exit mobile version
Skip to toolbar