Posts

Property Pane dynamic fields

Image
In most cases, we need to dynamically build the Property Pane based on some logics. Let's say we want to show some options only if some other property is chosen. In this article I show how to append a group of properties based on some logics. Let's say we want to show some information of a company's members. We want to choose a department, then a group of members that belong to that department and choose some of them's location. We can build a Property Pane Group that dynamically changes it's content. In this example, there is a function that returns an IPropertyPaneGroup object. That object contains an array of IPropertyPaneField objects. Inside the function we can implement all the logics to decide which fields we want to show and it's behaviours. In a helloworld project, we create the following function: private getConditionalGroup() : IPropertyPaneGroup{ let groupFields : Array<IPropertyPaneField<any>> = n...

Delete Pending API Permission Requests

Let's say you have a lot of pending API permission requests on your tenant and you want to delete them all. On your tenant's SharePoint Admin portal you can do it but there are two problems: a) You have to do it manually, one by one. b) If you have more than 100 pending requests, you only have access to the first 100. Everytime you delete one request, you have to refresh the page to have access to newer requests. Let's say you have deployed several times a WebPart and you have more than 1000 pending requests. That's a big problem! A fast way to solve it is to use a simple PowerShell script. Delete All Pending Requests $Url = Read-Host -Prompt 'Input your tenant admin URL (e.g. https://mytenant-admin.sharepoint.com)' Connect-SPOService -Url $Url do{     $requests = Get-SPOTenantServicePrincipalPermissionRequests     foreach ($req in $requests ){         if ($req -ne $null)   ...

Build a custom control for the Property Pane

In this article, I create a modular and reusable control for the Property Pane. I don't use react but, if you want to use it, the approach is similar. In the example, I build a number picker component. Read the tutorial  here .