Question

I have some JSON that is populated when a user sets up a web part, the JSON is used as the config i don't want to display this data to the user and I cannot see any way to simply hide a multi line property pane field. Does anyone know of a way to do this?

I have also looked at alternative solutions for storing and reading the JSON, one would be to simply store the data in a list, however the problem i see with this solution, is if and when the web part is deleted this data is still available and there is no way for me to be able to run a set of actions when the web part is deleted, leaving this unnecessary list on my tenant. The other option would be using the property bag, however this still leaves the same issue with not be able to clean up as and when the web part is removed.

Can someone please provide an alternation solution or a workaround for my issue.

Was it helpful?

Solution

If we're talking about an SPFx custom web part, you can defined a web part property but do not create a Property Pane Field for it. Thus, you'll be able to set it programmatically and users won't be able to modify it via UI.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top