In this blog article, I am going to describe all the steps required to get SharePoint list field values by using SharePoint Framework model which is SPFx.
If you are already familiar with SPFx then you might have a better understanding on SPFx application customizer.
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview
In this below-mentioned code example, I have taken application customizer of SPFx. I have also used PnP JavaScript library. The Patterns and Practices JavaScript Core Library was created to help developers by simplifying common operations within SharePoint and the SharePoint Framework.
This below-mentioned code example is very simple and straight forward. At first, you have to import ‘sp-pnp-js’ namespace, then you can use PnP library in code to retrieve SharePoint list and its field values.
This code snippet will help you to retrieve any column values of all list items present under a particular list. You just have to provide your list title and list field/column internal name in the following line,
In the above piece of code “My list” is SP list title and “Title”, “Id”, “CustomField_1”, “CustomField_2” are list field/column internal names.

Join the conversation! Your thoughts help the community grow.