Forum Discussion
Americo Perez
Jun 04, 2019Iron Contributor
How to populate the dropdown with list names
Hi, I am trying to create a dropdown in the property panel of a webpart with SPFx and I found this tutorial: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/use-cascading-...
Rahul Suryawanshi
Jun 11, 2019Brass Contributor
Hi @America
You can load all lists from current site or specific site collection by calling SharePoint REST API using SPHttpClient class of SPFx or you can use fluent APIs of @PnP which is great wrapper around SharePoint APIs.
You can more details about SPHtppClient class here
https://docs.microsoft.com/en-us/javascript/api/sp-http/sphttpclient?view=sp-typescript-latest
You can load all lists from current site or specific site collection by calling SharePoint REST API using SPHttpClient class of SPFx or you can use fluent APIs of @PnP which is great wrapper around SharePoint APIs.
You can more details about SPHtppClient class here
https://docs.microsoft.com/en-us/javascript/api/sp-http/sphttpclient?view=sp-typescript-latest