How to store setting for SharePoint Extension (sppkg)?
-
26-01-2021 - |
Question
I need to store site setting for new type of SharePoint extensions (spfx, .sppkg file). Are there any special approach to do this? Here is what I need to store:
- Store settings that user can not see and edit. For example some
configuration options for internal usage and a license ID or license file. - Store settings that user can edit (typically SharePoint site administrator or a person that installed the Extension).
Solution
1) To store such settings, would suggest that you make use of SharePoint Tenant properties. They allow you store key/value data and since they are tenant properties, they are available to be used across the site collections.
These can set by SharePoint admins only using PS command as:
Set-SPOStorageEntity -Key "LicenseId" -Value "0000-0000-0000-0000"
-Description "License for a specific purpose"
2) To store a setting that a user can edit, would suggest that you keep it simple and create a custom list with necessary columns and break the inheritance of that list to ensure that only a particular set of user's can modify its data.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange