How to Populate an SPFx Form Customizer Dropdown from a SharePoint List
Question details
The user needs to dynamically load values from a SharePoint list into a dropdown menu within an SPFx form customizer and set up a People Picker control.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Developing a custom form in SharePoint using the SharePoint Framework (SPFx).
- Observed behavior
- Requires developer guidance on retrieving list items through API calls, mapping them to dropdown options, and handling People Picker configurations.
Ensure you have the necessary site permissions to access the target SharePoint list and that your SPFx development environment is correctly configured with Node.js and Gulp.
Use SharePoint REST API or Microsoft Graph to Fetch Data
Retrieve items dynamically from your target SharePoint list and map them to your SPFx dropdown options.
When building an SPFx Form Customizer, you cannot directly bind a SharePoint list without writing custom code. You must utilize the SharePoint REST API (via SPHttpClient) or Microsoft Graph API to fetch the required list items asynchronously.
For complex development scenarios, it is highly recommended to consult the Microsoft Q&A platform under the 'SharePoint Development' tag, as community forums primarily focus on end-user support.
In your SPFx WebPart or Form Customizer project, ensure the `@microsoft/sp-http` module is imported so you can make API calls.
Create an asynchronous function using `this.context.spHttpClient.get()` to call the endpoint `/_api/web/lists/GetByTitle('YourListName')/items`. This will return the data from your target list.
Process the returned JSON response and map the specific fields (such as 'School Name') to the `options` property array required by your dropdown control (e.g., Fluent UI Dropdown), ensuring each item has a 'key' and 'text'.
To add user selection functionality, import the PnP SPFx PeoplePicker control, and pass your current context to it so it can securely query the directory.

Need a Lightweight Alternative for Everyday Office Documents?
While SharePoint handles complex enterprise portals and custom forms, you might also need a fast, reliable, and free suite for your daily document needs. WPS Office offers powerful word processing, spreadsheets, presentations, and PDF editing in a single lightweight application.
- 1. Download the installer: Visit the official WPS website and click the download button for your operating system.
- 2. Run the installation: Open the downloaded file and follow the on-screen instructions to complete the setup.
- 3. Open your documents: Launch WPS Office and instantly open your existing Word, Excel, or PowerPoint files without compatibility issues.

Frequently Asked Questions
Why is my SPFx dropdown not showing the fetched SharePoint list items?
This typically happens if the component state is not updated correctly after the asynchronous REST API call resolves, or if the mapped object array does not match the strict { key, text } format required by the Fluent UI Dropdown control.
Where can I get help for complex SPFx development issues?
Standard Microsoft Community forums primarily support Microsoft 365 end-users. For SPFx development issues, you should post your questions on the Microsoft Q&A platform using the 'SharePoint Development' tag to reach qualified developers.
Can I use PnP JS to populate the dropdown instead of SPHttpClient?
Yes, utilizing the PnP JS library is highly recommended for SPFx development as it simplifies REST API calls. You can use methods like `sp.web.lists.getByTitle('List').items.get()` to retrieve the data much more cleanly than manually writing SPHttpClient requests.




