It’s a fact that Visual Flow needed something that could make it more attractive to developers, and Salesforce did it.
Now we are able to integrate a Lightning Component as part of the Flow with just drag and drop and this blog will explain how easy it is.
Please, take into account that if your org is on Spring ’19, the look and feel of the Cloud Flow designer would be different because Salesforce is going to deliver Flow Builder
Using Standard Lightning Component
When we add a new screen to the flow, the first action is to add some new fields to show them. If we click on “Add a Field” tab, we can scroll down and under Extensions section, we can find Lightning Components label.
After adding it to the screen, you need to highlight it, so that you would be able to see all Standard Lightning Components that Salesforce already provides and we can use.
My example already have 2 radio buttons in order to decide if I would like to go ahead with the booking process or I prefer to stop it.
And I would like to show something nicer like a toggle, the one that I already selected.
Winter ’19 provides new Lightning Components we can add to flows. Toggle is one of them.
So the result would be like below image.
Using Custom Lightning Component
But what about if you don’t find the Lightning Component you really need on Flow? That is not a problem, because you can also create your custom Lightning Component and add it to the Flow.
Let’s talk about another example. We will create a simple Flow with 2 DatePickers. The first one is provided by Flow, however the second is a custom Lighting Component. How does it look like?
Their look and feel are similar and both work like tweens. The only difference with the Lightning component is that we can customize it. For instance, you can see that the size is larger than the flow one. Or you can change background color for instance.
How can we visualize in the Flow? First of all, remember that the DatePicker is a custom Lighting Component, so yes, you need to be sure that you implement a new interface in order to make it visible: lightning:availableForFlowScreens
So doing that, it will appear on flow with all standard lightning components that Salesforce already provide, so it is just a matter of drag and drop.
And that’s all, you have integrate your custom Lightning Component into your Flow.
Now Flow is beautiful as well as useful