fetch picklist values in lwc

Dynamically fetch picklist values from object In Lightning Web Component

Lightning Web Component

Today in this post we are going to learn that how we can dynamically fetch picklist or select list values from salesforce sObject and display in input select (with SLDS style) in salesforce lightning web component (LWC).

Check Also : Lighnting Aura Component Version

fetch picklist values in LWC

getPickListValueInLwcCtrl.apxc [Apex Controller] 

Don’t know how to create lightning web components ? check here…

getPickListValueInLWC.html [LWC HTML]

getPickListValueInLWC.js [LWC JavaScript file]

  • @wire: Gives you a way to get and bind data. This implementation simplifies
    getting data from a Salesforce org.
  • Check code comments.
getPickListValueInLWC.js-meta.xml [meta xml file]

To allow the component to be used in Lightning App Builder or Community Builder, set isExposed to true and define at least one <target>, which is a type of Lightning page.

Output :

fetch picklist values in LWC

Related Resources :
Other popular Post :

Follow us for new post updates. & Don’t forget to bookmark this site for your future reference.

Facebook : https://www.facebook.com/sfdcmonkey/

Instagram : https://www.instagram.com/sfdc_monkey/

 

About The contributor: 

Ravi Soni

1 Post Contribute

Salesforce Developer

Post By ravi:

  1. Dynamically fetch picklist values from object In Lightning Web Component

(Visited 1 times, 1 visits today)

(Visited 607 times, 1 visits today)

2 comments

Leave a Reply