In LWC, is it possible to get a pick-list field's possible values?
I'm writing a component that is embded into a lightning record page. I need my component to be able to load the record from the page, get data from the fields and use that data to pre-populate my search form with default values.
I have this working with city/state and checkbox fields. Right now the city/state fields are built pull data from an aggregate query of contacts to find all possible state/city combinations (I know this is doomed to fail when the records reach over 50k contacts but Its good enough for now).
I have a pick-list field on my object called skill level, I need to be able to build a combo box that has all the possible values for skill level and set the default value to the value on the associated record.
I'd like to avoid hard-coding the available options if possible.
In LWC, is it possible to get a pick-list field's possible values?
Best Answer
LWC does have a wire adapter that pulls in picklist values dynamically.