Demo embedding Flow (via Lightning Component) in Lightning Record Page and it reloading when the record is updated.
This project is a new take on my earlier project Reloadable Visualforce Lightning Component, whose purpose was to provide a way to display a Flow on a Lightning Record Page and have that Flow dynamically sync itself with any data changes made on the page.
That first project cobbled together a myriad of concepts, and although functional, it still didn't render the Flow in Lightning Runtime.
With Winter '18
we now have the lightning:flow component.
We no longer need an <iframe>
or Visualforce page to embed our Flow.
You may install the unmanaged code from GitHub and make any desired adjustments.
This will add a Lightning Component named ReloadableFlowCmp
to your org (label in App Builder is Flow - Reloadable).
- Install this unmanaged package to your org using link above.
- Edit (or create new) a Lightning Record Page for an object (e.g. Account).
- Ensure the Standard component named Record Detail is on your Lightning Page.
- Drag the Custom component named Flow - Reloadable onto your Lightning Page.
- Configure the Custom component by specifying Flow Name (e.g.
Your_Awesome_Flow
). The Flow should have an input variable namedrecordId
of typetext
that the component will pass to the Flow based on the record being viewed.
- Save and Activate your Lightning Record Page.
- Navigate to a record page to test.
- Edit and save the record and notice your Flow refreshes too!
- Click the Finish button on your Flow and notice the rest of the page refreshes too!