getPicklistValues

Use this wire adapter to get the picklist values for a specified field.

getPicklistValues uses this User Interface API resource.

  • recordTypeId—(Required) The ID of the record type. Use the Object Info defaultRecordTypeId property, which is returned from getObjectInfo.

  • fieldApiName—(Required) The API name of the picklist field on a supported object.

  • propertyOrFunction—A private property or function that receives the stream of data from the wire service. If a property is decorated with @wire, the results are returned to the property’s data property or error property. If a function is decorated with @wire, the results are returned in an object with a data property and an error property.

Using objectApiName with this wire adapter isn't supported since this information is also already included with fieldApiName.

Picklist values are scoped to a record type. For dependent picklists, getPicklistValues returns data for controlling fields and how they map to the picklist. For more information, see Build UI for Picklists.

To retrieve all picklists of a record type, use getPicklistValuesByRecordType instead.

See the wireGetPicklistValues component in the lwc-recipes GitHub repo.

See Also