Author Archives: Dan

Using emojis for easier JavaScript debugging

I normally don’t care much for emojis, but lately I’ve found them to be helpful when working with JavaScript. The JavaScript console may not be the most elegant way to debug, but it’s the quickest and sometimes only reasonable way … Continue reading

Posted in Development, Tips | Tagged , , , | Leave a comment

Attaching a context menu to DetailsList column headers in Fluent UI

I wanted to show a menu when clicking the column headers of a DetailsList, similar to how SharePoint does it. Fluent UI 8 does not have any built in support for this, so I had to figure out a way … Continue reading

Posted in Development | Tagged , , , , | 1 Comment

Better cache management in ASP.Net Core (LazyCache/FusionCache)

LazyCache and the newer FusionCache are two great libraries that simplifies working with caching in ASP.Net Core. Something I’ve often been missing though is the ability to dispose of the entire cache, not just single items. (My understanding is that … Continue reading

Posted in Development, Tips | Tagged , , , , | Leave a comment

Modifying SharePoint list permissions with PnP Core

Working with SharePoint permissions is not always straight forward. This code snippet is an exercise using PnP Core to modify permissions on lists with unique (broken) permissions. All assigned permissions are changed to read only, except for owners group of … Continue reading

Posted in Development | Tagged , , , , | Leave a comment

Show React dialogs fluently with hooks and promises

Suppose you have a React component that displays a modal dialog and returns the result:

The typical way to use it would be to have a state variable controlling if it should be displayed or not, and a function … Continue reading

Posted in Development, Tutorials | Tagged , , , , , , , , | Leave a comment

A faster way to get effective permissions with PnP Core

PnP Core SDK has built in functionality to get effective permissions for a user on a list item in SharePoint:

This is pretty slow; typically ~1000ms. So I tried calling the REST API directly instead:

Turns out this … Continue reading

Posted in Development, Tips | Tagged , , , , , | Leave a comment

Searching with Microsoft Graph Client Library for .NET

Using the MS Graph SDK for .NET is convenient but I find the documentation and examples pretty lacking. So when wanted to use the Search endpoint it took me quite a while to figure out how to make it work. … Continue reading

Posted in Development, Tips | Tagged , , , | Leave a comment

Finding out what service created a SharePoint site

SharePoint is the underpinning data storage for many Microsoft 365 services. Sites are are therefore created under the hood by many services. Sometimes it it useful to know from where a site was created. We can actually find this in … Continue reading

Posted in Development | Tagged , , , , | Leave a comment

Starter project for AzureAD authenticated communication with ASP.Net Core 6 API, React SPA and console app

Setting up authentication for a new project is important but can be a pain since all the pieces must fit together perfectly. I recently struggled with one of my projects, and for future reference I decided to create a starter … Continue reading

Posted in Development, Tutorials | Tagged , , , , , , , , , , , | 2 Comments

Read & Write MS Office custom properties with PowerShell

While working on automating Microsoft Word I needed to read and write custom properties in documents. I found several resources out there. Reading worked fine, but when writing custom properties they all crashed. I finally managed to fix it though, … Continue reading

Posted in Development, Tutorials | Tagged , , , , , , | 2 Comments