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.



Hi Rich,
First, thanks a lot for this great component. It works like a charm for my user (admin).
In our use case, we need to retrieve the developer name of the selected record type in order to check for duplicate at a later stage in the flow.
Unfortunately i’m only able to save the record type id in your Record Type Picklist component and the Get Record returns ‘failed to find records’ when the flow is ran as a non-admin user:
Get_info_of_selected_Record_Type
Find all RecordType records where:
Id Equals {!SelectedRecordTypeId} (012000000000000AAA)
Store the values of these fields in Get_info_of_selected_Record_Type: Id, DeveloperName, Name
Result
Failed to find records
Would you have any workaround for to achieve this?
Thanks again and best regards,
Xavier
Hi Xavier,
You’re welcome, I’m glad you find it nice!
The first thing to check is that the User has access to Record Types. I believe that the Id that you found is the Master Record Type Id, meaning that the User has not been assigned Record Types. I also believe that might be why you are getting the error. Either you should be getting record types back, which may mean that if the User does have access to record types, they might need access to the Apex Class, ecflc.flowUserRecordType, or you need to check first to see if they are using the master Record Type, and if they are, then do something else instead of search for the Record Type developer name.
Let me know how it goes!
Rich
Hi Rich,
Thanks for your answer, it helped me finding out what I was doing wrong. Basically, in the Record Type Picklist component, I had to leave Default Value / Selected Value empty and only keep the record collection variable in Picklist Values.
It’s now working fine for standard user.
I’m not 100% sure why, but for me the selected value would always come as the master record type in the debug. (PS: our users don’t have access to RT through Profiles, only through Permission Set)
Thanks again
Best regards
Xavier
May i know which action did you choose for Get Available record types.
Hello, it is the Get Available Record Types action.
Hello, where does this functionality exist? I cannot find this flow action. Could you please help ?
What type of flow are you trying to create? If you create a screen flow, pull in an action, and then search, you should be able to find it there.
Hi Rich and thank you for your reply! I am creating a Screen flow, however i cannot find the action in my Sandbox. 🙁 Do i need to install a package?
Yes, Flow Components from the AppExchange.
Hello, I have 2 questions.
1. Is it possible to filter the record types to show specific ones?
2. After you select a record type, can the page layout related to the selected record type be displayed in a screen flow?
Thank you!
Love the component! However, it shows inactive recordtypes as well that are available. Do you know a fix for this?
Hi Ben,
Are you using the Get Available Record Types action to populate the Record Type Picklist? The action is checking for active record types in addition to record types allowed for the user, ensuring that they only see the one that they are allowed to use.
Hi
This is a great solution!! Thank you!
Just one question, The record type that the APEX looking for, is only the record type on the profile? or also on PS/PSG, Sharing Rule and more..?
Hi Ariel,
It will be all the record types that is allowed to the user, so it could be part of the profile or added through permission sets.
Rich
Thank you so much Rich!
Last question, there is a way to translate the picklist on the screen flow?
there is a way to translate the picklist on the screen flow?
Here is an example of a no code version, examples are given on how to filter the list as well:
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8zUTSAZ
Yes, but not all users will have access to create all record types, and it will not list the default record type for the user. If that isn’t a concern, then the record type picklist lookup in flow works, but if users have restricted picklist types or different default record types, that starts to not work, which is where this comes into play.