function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shuhbam SinhaShuhbam Sinha 

How to get the list of object and its all fields in LWC

Hello Everyone,
I have one requirement to create one LWC component and fetch list of objects and its associated fields by creating two lightning comboboxes one for list of object and one for list of fields from selected object. Once user selects the field it should show the api name of the field. Can anyone please help me on the same. Thanks in advance
Gian Piere VallejosGian Piere Vallejos

If you want to fetch the data from a Standard Object you can use the wire get data form: 

- https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_wire_example

If you want to fetch more complex data related to Custom Objects, you can use imperative methods like this:

- https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_call_imperative
- https://developer.salesforce.com/forums/?id=9062I000000R10IQAS

Let me know this information has helped you.