Category Archives: Tips

Short tips and lifehacks

How to get “order” and “level” for pages in OneNote Graph API

Quick tip: To include the order  and level  properties when getting pages with the Graph OneNote API, you need to add ?pagelevel=true  to your request. This is not mentioned in the documentation.

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

Moving Term Sets Accross Site Collection Maintaining Term ID:s

In SharePoint we have the Term Store for managing reusable terms. Besides tenant level term groups, which are available to all site collections, each site can have their own group. There are situations when you need to move term sets … Continue reading

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

New-MgOauth2PermissionGrant : Missing property: clientId

I was trying to add some permissions to the (new) SPFx app. This is done using the New-MgOauth2PermissionGrant  cmdlet. All examples shows using it with -BodyParameter :

But this did not work for me. All I got back was an … Continue reading

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

Azure Functions suddenly returning 403 when called from SPFx

Microsoft has recently made a change to SharePoint Framework that might break existing solutions that use an Azure backend (e.g. a Function App) that is secured to only allow requests from SPFx apps. For us, our Azure Functions suddenly started … Continue reading

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

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

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

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

If Word randomly crashes when opening SharePoint documents

I’ve been working on a PowerShell script that automates Microsoft Word to open all files in a SharePoint library, modify the header and other properties and then save it again. I ran the script against 4000 documents and everything went … Continue reading

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

Excluding page templates in CAML queries

Typically, when requesting SharePoint pages we do not want to include templates, just normal pages. When saving a SharePoint page as a template, this is noted in a property called OData__SPSitePageFlags . With this information we can easily exclude templates by … Continue reading

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