Today we will learn about show a success message by using flow.
Step 1 :- Create a lightning component
ToastMessage.cmp
ToastMessageController.js
({
invoke : function(component, event, helper) {
var message = component.get("v.messageText");
var type = component.get("v.type");
helper.showToast(component, event, helper, type, message);
}
})
ToastMessageHelper.js
({
showToast : function(component, event, helper, type, message) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"message": message,
"type": type,
"duration": 10,
"mode": "dismissible",
});
toastEvent.fire();
}
})
ToastMessage.design
Step 2 :- create a flow and drag a Action from Interaction section

Step 3 :- Select created component in Action

Step 4 :- Enter the message that you want to display into messageText box.

Output : -
