In Salesforce, any Admin is able to restrict Picklist values based on RecordTypes. This enables a differentiation between business processes in data input and user guidance. Think of Case (Close) Reasons, or Opportunity Stages, showing different values dependent on whether it is a Question vs. Complaint Case, or a Sales vs. Service Opportunity. With this, the user is guided through the process and not distracted by Picklist values you don’t want to be available.

While the dependency between RecordType and Picklist values is respected in many UI locations in Salesforce, it is unfortunately not respected in Lightning Flow Choices. Causing all picklist values to be shown and losing the User Guidance.

This has been shared by many over the past years (Salesforce Idea – 633 votes) and many blog and StackOverflow posts discuss different options. Unfortunately, the response of Salesforce is limited to a Managed Package for dependent picklist values and the expectation is this will not be fixed before 2021 (while dependent picklists were added to Flow by Winter ’16)…

The solution

Luckily, there is a solution thanks to one of the latest Lightning Web Component feature: lightning-record-edit-form. This beauty allows to make sure the picklist values only show the ones satisfying the database-validations and thus also RecordType dependencies (preventing exceptions like: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST).

Putting together, this feature and the usage of textual schema references, allows to create a generic easy-to-use component for any future RecordType Restricted Picklist Values in your Lightning Flow.

The final component is available at:

What is it?

RecordType Restricted Picklist Value Selector
LWC RecordType Restricted Picklist Value Selector in Lightning Flow Screen

This Lightning Web Component is a light-weight form containing one field. Based on the provided configuration, specifying Object and Field Name, the RecordTypeId and ability to enforce input – including custom error message – the component is loaded, showing only the values of the Picklist Field related to that RecordTypeId.

How to apply

In the LWC-RecordtType-PicklistValue-Selector repository, you can find the source code of this Lightning Web Component. Simply download the three LWC related files and deploy that to your own Salesforce environment.

Deploy to own environment: No developer on your project, or challenged is creating this new Lightning Web Component? Feel free to reach out, I’m more than happy to support you, or apply to make this an Unmanged package.

After deploying to your own Salesforce org, you can open any Lightning Flow Screen and drag-and-drop the component ‘RecordType Picklist Values’ to the screen. Specify the input to your context and you are good to go!

Implementation Considerations

  1. The input values in the screenshot above, are purely for documentation purposes to show the correct format;
  2. NEVER put a hard-coded RecordType Id as input. Either retrieve this dynamically from the record you want to edit/create (e.g. {!sObj_Case.RecordTypeId}) or query this via a GET-action (e.g. {!Get_RecType_CaseQuestion});
  3. Best-practice is to display text using CustomLabels, especially when in multi-language context. The error message is therefore recommended to reference a Formula Resource (e.g. {!Form_Label_RequiredPicklistValue}), which fetches a CustomLabel ( $Label.Flow_Validation_PicklistValueRequired).

What’s behind it?

Aside from the usage of standard components there are a couple tricks which might be interesting to describe a bit more in details. For those interested, some documentation is provided for each of the three component files:

    <lightning-record-edit-form object-api-name={objectName} record-type-id={recordTypeId} >
        <lightning-input-field field-name={fieldName} value={fieldValue} required={isRequired} onchange={handleFieldChange} ></lightning-input-field>

The template file (.html) only contains a lightning-record-edit-form which has two String parameters: object-api-name and record-type-id. While most documentation show the injection of Schema references, Salesforce also accepts textual-inputs, which is awesome, as this allows our component to be fully reusable and generic for any valid String combination of Object name and RecordTypeId.

// (..) Imports
export default class RecordType_PicklistValues extends LightningElement {
	// (..) Attribute definitions
    /* Optional Attributes */
    // {Boolean} Whether or not the input is required
    @api isRequired;
    // {String} Error message non selected
    @api errorMessage;

    /* Output Attributes */
    // {String} API value of selected picklist value (not the label, but the value)
    @api fieldValue;
    // {Validation} Function Lightning Flows execute on 'next'-button to validate whether component is valid
    @api validate() {
        if( !this.isRequired
            || ( this.isRequired && this.fieldValue && this.fieldValue.length > 0 ) ){
            return { isValid: true };
        } else {
            return {
                isValid: false,
                errorMessage: this.errorMessage

     * Function to handle picklist selection and assign to fieldValue
    handleFieldChange( event ){
        this.fieldValue =;

In the Controller (.js) only one thing is worth mentioning, as the rest only concerns standard Javascript logic: the @api annotated validate() function. This function is called by a Flow before moving to the next step, so on ‘next-button-click’. Flow will always call the validate() function on any component on the page, allowing custom validations, like making it conditionally required as is done in this particular component.

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="">
    <description>RecordType Picklist Values</description>
        <targetConfig targets="lightning__RecordPage" >
            <property name="objectName" type="String" label="Object Name" required="true" />
            <property name="recordTypeId" type="String" label="RecordTypeId" required="true" />
            <property name="fieldName" type="String" label="Field to show picklist values for" required="true" />
        <targetConfig targets="lightning__FlowScreen" >
            <property name="objectName" type="String" label="1) Object API Name" role="inputOnly" />
            <property name="fieldName" type="String" label="2) Picklist Field API Name" role="inputOnly" />
            <property name="recordTypeId" type="String" label="3) RecordTypeId" role="inputOnly" description="Id of RecordType Id, fetch from record {!sObj_Account.RecordTypeId} or from Get {!Get_RecordType.Id}" />
            <property name="isRequired" type="Boolean" label="4) Required input" role="inputOnly" default="false" />
            <property name="errorMessage" type="String" label="5) Error message" role="inputOnly" description="Error message shown to customer when input required, but not populated" default="Please select a picklist value"/>
            <property name="fieldValue" type="String" label="Selected value by user" description="The API value of the selected Picklist value" />
    <masterLabel>RecordType Picklist Values</masterLabel>

The metadata file can be fully understood when reading Salesforce documentation, but most important is to conclude:

  1. The component is exposed to both FlowScreens and RecordPages;
  2. Only on FlowScreens it is possible to add the isRequired attribute, since no validation is called on RecordPage;
  3. Logically, one can deduct there is no reason of adding this component to a RecordPage (yet), since there will be no action triggered by selection, but this was more added for the showcase;
  4. Note, in the Flow Builder attributes are shown in alphabetical order. Hence, the 1), 2) were prefixed to ensure the Admin is guided in the process of configuring this component.
  5. Role is only defined for FlowScreens and can be set to InputOnly and OutputOnly. Attributes which can be used both for input and output, like fieldValue, don’t need a role to be specified. Those are then available to both (default value).

Other options

Of course, there are still other options which could help you out, but in my perspective this requires more custom coding, or uncontrollable code in your environment.

  • Create generic component which does a UI-API callout and show the retrieved values;
  • Create Utility method using validFor() and Base64decode to find Picklist Dependencies (kinda like this);
  • Install Managed Package which supports the same.


Finally, there is a work-a-round till Salesforce will make sure Dynamic Choices in Lightning Flows will be restricted by the available RecordType.

Feel free to apply this Lightning Web Component where needed. In case you have any feedback, improvements or suggestions, feel free to reach out so others can benefit from it as well.

How useful was this post?

Average rating 5 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

8 thoughts to “RecordType restricted picklist values in Flow

  • Claire

    I appreciated your component but when i have one value on a picklist marked as Default , it’s not working. The flow doesn’t populate my field.
    DO you have an idea?

    • Reinier van den Assum

      Hi Claire, awesome to hear the component could help you partially for your request. I believe the default value will not be available by the lightning-input-field implementation of Salesforce. However, you might be able to ‘trick’ this around a bit. In your Flow you’ll assign the ‘fieldValue’ variable to derive the selected value of that picklist. When you would assign a Default value to that fieldValue variable resource in your flow, that should be selected on screen-load. This would still not allow you to show the configured Default, but might help you the initial bit.

      One more thought, though that is kinda a wild guess… maybe you can initiate a record of the Object you want to show the picklist for and pass that reference into the Flow, I would expect Salesforce to populate the Default value when you create a Flow Variable Resource of type Object, and that would potentially allow to have it prefilled on the first screen load.

      Hope that might help you out!

  • Gary

    Thanks for developing this!

    Please can I request that you release this component as an unmanaged package, so it can be quickly installed in a Salesforce org?

    I do not know how to deploy a component such as this manually.

    Thanks 😁

    • Reinier van den Assum

      Hi Gary, thanks for your reply and I’m happy to hear this might be of any help for you. Unfortunately, I’m away from my laptop for next week, so unable to reply to the fullest and see whether or not to release as unmanaged package.
      Till that time you might be able to implement this in your sandbox (and production) via below link. Simply click the login button in the top right, connect and deploy. I haven’t been able to test this, but hope it can help you out in the meantime. Else I’ll come back to it in 1-2 weeks. Kind regards, Reinier

      • Tom Ford

        Tried using the herokuapp link but it just says it encountered an error.
        Any chance this will be packaged in the future?

  • Sagnik

    This is super Reinier, I initially though of using UI API callout but this does seem to be a more cleaner approach .!

    • Narendra

      Hi Reinier van den Assum

      I am trying to access the selected picklist value but it is showing null . any reason ?

      • Reinier van den Assum

        Hi @Narendra! Apologies for the later reply. Do you mean in the LWC or in the Flow? It might be that Salesforce changed the implementation of the lightning-input-field onchange behaviour and you need to change the to event.details; Might be worth to dump the event to see where the value sits. Feel free to send me an email with some more details, in case this is still impeding you. Happy development!


Leave a comment to Reinier van den Assum Cancel reply

Your email address will not be published. Required fields are marked *