Flow Components has the ability to use a Lightning Component to launch a Flow through the click of a button. Launching a Flow through a button prevents the Flow from auto running when a record is loaded.
Using Lightning App Builder, you can find the Run Flow Button Lightning Component in the Custom – Managed Components section.
Once you drag it and drop it onto the page, you’ll be able to configure the component. The parts that you can configure are:
- Button Label
- This is what will display to the User as the button
- Flow Name
- This is the API name of the Flow
- This is optional. If you want to display a title to the Lightning Component card background, you can enter the text here.
- Reload Flow When Record Refreshes
- If this is checked, if the Flow has started and the Record has been updated after, it will refresh the Flow to start again.
- Reload Button When Flow Finishes
- If this is checked, when the Flow finishes, instead of staying on the default screen that lets the user know the Flow finished, it will reload the button to allow a User to start again.
- Refresh Record When Flow Finishes
- If this is checked, after the Flow finishes, the record will refresh and will display any updated information as a result of the Flow.
Hello, I’m using this button on a community page in conjunction with a simple ‘quick case creation’ flow that I have. The button shows up fine, but has an issue with starting the flow, showing an error message when clicked that is referencing a variable that doesn’t exist in the flow:
“The value null is being provided for variable recordId but isn’t compatible with the variable’s data type (String). Check the places where you implemented the flow ‒ such as through a Lightning page or a custom button ‒ and make sure that all provided values are compatible with the variables’ data types.”
The ‘recordId’ variable is not in my flow, and I can’t figure out why it would be referencing that. When I run the flow without the button, it works just fine and shows no error, so I’m wondering if there is something about the button I may be missing that you could help me with. Thanks in advance for your time!
Can you create a variable, recordId (with the capitalization like that), as a text input variable? The button passes the record id of the record, so if there isn’t a way to receive it, that could potentially be the problem. Even if you don’t use it in the flow, it might help. If that doesn’t work, please let me know, thanks!
Hi Rich, this worked perfectly! Thanks so much for your quick input, this component just solved a huge problem for me!
Hi Rich, unfortunately I may have spoken too soon – while the flow now works in my ‘preview’ of the community, the changes are still not working on the user end when I try it there, and I get the same error. I tried adding in a ‘default’ value of a dummy recordId, but that didn’t work. Any other suggestions? I appreciate your time.
If it helps, I just tested the button with flow in a regular lightning page and it DOES function properly there. It’s only not working in the Community. Any insight would be appreciated but I understand if it just may not work there.
I’m having the same issue with community pages. Did you find a solution?
You don’t need to redirect with the Run Flow Button. There are settings in the lightning component itself to reload button when flow finishes and refresh the record when flow finishes, that should be enough if you’re staying on the same record.
Yes sir, but it complains about not getting a recordId passed in if it’s on a community page. I just couldn’t get around that bit. Otherwise it’s an amazing thing.
Hi, I am using this button and I have the option ‘refresh record after flow finishes’ checked in the lighting page editor, however the record does not refresh automatically, and instead the box just says ‘YOUR FLOW FINISHED’ and the record still needs to be refreshed manually. Any suggestions? (If it matters I have all three boxes checked – reload flow, reload button, and refresh record.) Thanks in advance
I am having the exact same problem as Abel. I have this option checked:
Reload Button When Flow Finishes
But the button is NOT redisplayed on the page when the flow ends, only that my flow executed successfully. It would be nice if this would work.