Meet my new Dynamic Flow Launcher!
Hola! 😀
I am very excited to share this one with you guys! Kinda like a Dreamforce gift from my side to my fellow trailblazers.
So what this component is about?
As the name suggests, it’s a flow launcher that allows a user to call a flow, both Screen flow and Autolaunched flows, from almost anywhere within Salesforce. The launcher is essentially a lightning component, so all the places where you can think of putting a lightning component, you will be able to use this component. Though there are some considerations that you will have to keep in mind while using it which I will be discussing towards the end of this post.
Why this component?
I will be honest. At first, I was very curious and excited what can I build using the new Flow objects introduced in Summer 19 release.
The idea behind was to create a component which can simply let you choose a flow and launch it. Now if we drill a bit into how we can use it, we realize it can be quite handy in some situations. I have listed some of them which I feel can be quite useful. These may not seem very major but still can be useful depending on the use case:
Very basic one: We can simply select any flow from the picklist and run it at go. Use the basic flow filters according to your convenience.
We can bind this lightning component to a Quick action which we can later use on record pages.
We can also call this component from a Global Action, which gives us the flexibility to call any flow anywhere we want.
You can also use the component with in flow screens!
You will be able to call Autolaunched flows at go without actually having to call them from Process builder.
You can not only ‘run’ the flows but also run them in Debug mode if you wish to.
While running the flows, you can pass values to flow input variables and also store the values of flow’s output variables for later use.
You can also open the flow directly into flow builder.
You can choose to show/hide the Flow header and Flow stats.
You can also tell me how you feel it can benefit you or help you solve your use case, and I will have that added to the list! 😀
How to use it?
I have created an unmanaged package which you can install in your Sandbox start right way. The package will contain three lightning components(including some other stuff):
DynamicFlowLauchCMP to use in App/Home/Record pages.
DynamicFlowLauncher_QuickAction to use in Quick/Global actions.
DynamicFlowLauncher_Flows to use in Flow screens.
Why separate components for Quick action and Flow? That’s because the modal width is an issue while calling component from Flow screens or a Quick action. So I created a wrapper component to increase the modal width and then call the flow launcher inside it.
Considerations for the usage
If you are launching an active flow, the active version of that will be launched.
If you are launching an inactive flow, the latest flow version will be launched. Also, inactive flows by default will run in Debug mode only.
The flow selection picklist only displays the Screen and Autolaunched flows.
Do not make any changes to the code unless you know what you are doing.
When you run the flow, you will notice that there is some problem with the styling(UI) of the Flow screens. That’s because the flow is launched via aura component(I am just guessing on this one). So it may be a case where not all your flows are running as you expected from the UI standpoint.
I wouldn’t recommend using this component in utility bar because of the component width issues which I haven’t been able to figure out yet. Instead you can use a Global action to call this component.
You will not see the Flow header and stats while launching the component from Quick Action.
Let me know if you are experiencing any problems or if you have suggestions on how we can enhance the usability of this component.
Hope it makes your life a bit more easy! See you in my next post 😀
Wait where is the ‘traditional’ Demo GIF?
Almost forgot! Here is the link to the demo: https://twitter.com/Nads_P07/status/1191681717935001600
Cheers! 😀
Thank you for being an awesome reader! Subscribe to this blog for receiving all the latest updates straight to your inbox. 🙂

.png)




Comments