Record Type Picklist and Available Record Types for User in Flow

Getting the available Record Types in the org versus the Record Types a User is allowed might be different. To help this in Flow, a new Apex Action, Get Available Record Types, was added in the Winter ’21 release. This Apex Action will get the available Record Types that the User has access to, including the default record type, to help ensure your User is creating Records using Record Types they are allowed to use, with ease. Additionally, there is a Lightning Component, Record Type Picklist, that will allow you to easily show the Record Types to User and use the selected Record Type later in the Flow.

First, take a look at the Apex Action, Get Available Record Types. In the example below, we are looking up the available Account Record Types for the User. To do this, you first enter the Object API Name, in this instance, Account. You will need to click the box, Manually assign variables (advanced) so that you can set your variables appropriately. Then, you need to have a text Variable to store the default Record Type Id for the User. Finally, you need to have a collection Variable, type of Object, where the Object is Record Type, to store the full list of Record Types available for the User. See second screenshot for an example.

After you run the Get Available Record Types Apex Action, you then can use the Record Type Picklist Lightning Component in a screen to allow your Users to select the record type they would like to use. As you can see in the example below, you use the default record type id as the Default Value / Selected Value and you use the Record Type collection variable as the Picklist Values. Additionally, it is recommended to click the Manually Assign Variables (Advanced) and use a text variable to store the Id of the Record Type that the User selected in the Default Value / Selected Value. You can then use this text variable as the Record Type Id in any record that you’re creating.

Run Flow Button Updates – Winter ’21

With the Winter ’21 Flow Components update, the Run Flow button is now available from:

Home Screen

Experience Builder (formerly Salesforce Community Cloud)

When redirecting from a community button to a record, the URL structure for communities is different than lightning or classic. To redirect in communities, redirect to a URL and ensure that you start the URL with “/detail/” followed by the Id that you’re looking to redirect to. Example screen shot is below, where {!Create_Account} is the Id of the Account that was created in the Flow.

Call Flow in Lightning Runtime through a URL

Calling a Flow from a button through a URL link has been something that has been available in Salesforce for a while now. Using the URL runs the Flow in classic mode, but you can extend to Lightning through Enabling Lightning Runtime for Flows. This, however, does not work with the Lightning Navigation Service, and as a result, the ability redirect the Flow to a record that was created inside of the Flow or control the navigation is not easily done.

With Flow Components Winter 21 release, we’ve created a Lightning Component that you can call via URL that will start your Flow. As it is a Lightning component, it works with the Lightning Navigation Service, allowing you to be able to use the Flow Components Redirect to Id or Redirect to URL.

In order to call the Flow, you create a button like the one below, where recordId is the recordId you want to pass in and flowName is the name of the Flow.


Additionally, in your Flow, even if it is not used, you need a variable, named ids, that will allow for input. The variable should be a text input variable and it can be a multiple records input, like the one for the Related List Button.

Without this variable, you might see an error message similar to the below error message.

And that’s it. Now you can use Flow Components Redirect to Id or Redirect to URL with your URL launched Flow.

Flow Components – Winter ’21

There are a few new exciting things coming to Flow Components in our Winter ’21 release! We’ve created a lightning component which allows you to call a flow via a URL, which means that you can use this with Lightning Runtime. Additionally, it works with related lists in records where you can select multiple records to send to a flow, using a very small visualforce page. And one of our favorites, the ability to query records using the SOQL “IN” condition where the Ids are in a collection variable. We hope you’re as excited for this release as us!

Related List Button to Send Records To Flow

Call Flow in Lightning Runtime through a URL

Run Flow Button Updates – Launch from Experience Builder (Formerly Communities), Home and Utility Bar

Record Type Picklist and Available Record Types for User in Flow

Query Records by List of Ids in Flow

Run Flow Button

Run Flow Button - Lightning App Builder

We’ve updated our component, check out the updated instructions here!

Using Flow is one of the most powerful tools for an admin. The ability to create your own complex workflow allows you to effectively implement your business processes without code.

There are three ways Salesforce has allowed you to launch a Flow from a page as an admin. You can create a button with a URL button, something like “/flow/myFlow”, you can use a Quick Action and run the Flow inside of that, or you can add it to your page layout with the Flow lightning component. These are great ways to be able to run Flows, but there are a few short comings.

First, if you use a Quick Action or a Button, you can’t dynamically show or hide the Quick Action or the Button, you’re stuck using Page Layouts. Second, if you’re using the Flow lightning component, when it loads on the page, it will always run. An example below shows a New Contact Flow that always runs on the page.

This is why we built the Run Flow Button lightning component. Salesforce allows developers to run Flows in lightning components and now we’ve brought this power to the admins.

To use the Run Flow Button lightning component, simply open Lightning App Builder, drag the Run Flow Button lightning component onto your page, enter text for your button, add the Flow API Name, and now you have a button that your users can press when they want to run the Flow.

Since it is a lightning component, you can also dynamically show or hide the button based on the lightning component filter criteria.

With your Run Flow Button configured and your filters set, you’re ready to give your users an enhanced experience with Salesforce lightning!

Flow Components

Redirect Flow Example

Lightning Components to Extend your Flows

We’ve created a Package to extend your Lightning Flows using Lightning Components. We’re working on getting the full documentation for you and posts about each of the Lightning Components. Feel free to download the package from the AppExchange, we’ll add the new posts as soon as possible!

Lightning Component – Redirect Flow – Use inside a Lightning Flow to dynamically redirect the Flow to any URL you set or allow Users to click on a Button to redirect them. This includes redirecting Users to a record that was created inside the Flow, or adding URL variables, such as with a Conga Composer button, based on User selections inside the Flow.

Lightning Component – Run Flow Button – Use on a Lightning Page to create a button that when clicked, will run a Lightning Flow. Instead of the Flow running automatically when the page is rendered like the standard Flow Component, this will only render the Flow when a User clicks the button. Can be combined with Component Filters to only show the button in certain situations.

Apex Action – Unlock Record – Use inside Process Builder or Lightning Flow to unlock a record. Helpful for unlocking a record after an outside action has happened, such as a Quote being declined in an e-signature process, allowing a User to then edit the Quote again and resend for signature from the client.

Apex Action – Lock Record – Use inside Process Builder or Lightning Flow to lock a record, no standard approval process required. Helpful for building custom approval workflows with record locking at the end when the standard approval workflows are not robust enough.

Lightning Component – Locked Record Notifier – Use on a Lightning Page to notify the User if a Record is locked. Enter in your custom message to the User if the Record is locked in the Lightning App Builder. Lightning Component will not display if Record is unlocked.

Apex Action – Get Available Record Types – Use inside Lightning Flow to get the available Record Types for a User, based on the Object. Default Record Type Id for that User is sent back in addition to the List of Record Types allowed for the User. Use with Record Type Picklist Lightning Component to display Record Type selection to the User in a Lightning Flow.

Coming Soon – Lightning Component – Record Type Picklist – Use this Lightning Component inside a Lightning Flow Screen to display Record Types to the User for selection. Use in conjunction with the Get Available Record Types Apex Action to show a User the Record Types they are allowed to create.