Tech and me

Tuesday, May 22, 2018

If you take a look at the manifest schema for a SPFx web part there are a couple of settings you might want to take a look at.

hiddenFromToolbox

If hiddenFromToolbox is set to "true", the web part will not be visible in the modern SharePoint toolbox. Very useful for web parts you provision automatically on pages, but don’t want users to add themselves.

supportsFullBleed

If supportsFullBleed is set to "true", the web part can be added to a full page width zone on a modern page in a communication site, spanning from the left margin to the right margin without any white space.

The caution is that when you expand a property which has a collection of values, you will only get the first 20 items returned. This means that if you work in an organization with more than 20 people in it, you should not use $expand if you need all the values, but resort to two calls instead, one for the item, and one for the property you want to expand.

Summary

While using expand is very handy, it’s almost always better to break it into two API calls to avoid having issues if you can expect more than 20 items.

Tuesday, May 8, 2018

This is one of the snippets I always forget, but which is very handy in cases where you have the absolute URL to an item in SharePoint. The magic is really line 6 which uses the static method WebUrlFromFolderUrlDirect to get the web URL of the file, so that you can connect properly.

Sunday, May 6, 2018

Joanne Klein asked on Twitter if there is a way to get all places where a specific term set is used in SharePoint.

One way would be to iterate all site collections and check if the term set was present in the Hidden Taxonomy List, which stores all used terms on a site collection (and if you have no idea what that is, that’s ok as well).

Hidden Taxonomy List at /Lists/TaxonomyHiddenList/AllItems.aspx

Another option which is the solution I proposed, is to use search. Of course you need to have read access to the items where the term set is used for it to be 100% accurate as well items using terms from a term set has to be present in the search index.

Friday, May 4, 2018

Again I’m late to the party, but Microsoft has released an action to Flow called “Set content approval status”. This action enables you to add content approval not only to list elements and documents in SharePoint, but also to news pages.

Microsoft has talked about content approval for ECM scenarios with communication pages for a while, but until a proper UI is in place, you can get started today!

Good news is you can use both actions interchangeably. If you want to get the properties for a document library using the Get items action simply pick Custom value in the dropdown and enter the title or id for your document library and it works just fine (been using this already a while).

So, to me, having the Get files (properties only) action seems unnecessary, but for some users it might be easier to understand with two different actions targeted towards lists or libraries.

Thursday, April 26, 2018

Last year at Ignite we were all psyched that Microsoft gave us a replacement for the old Document Information Panel (DIP) in Word which allowed us to set metadata stored in SharePoint columns. DIP disappeared with Office 2016 (and you had to edit properties in the info settings page instead), and finally we got a replacement. However, it only worked for documents stored in SharePoint Online.

I did a proof on concept of this with a colleague last year as well, so it was just a matter of time until it was properly release.

The announcement slipped past me as there has not been a lot of whoo hah around it. Reading the release notes for the December 2017 CU for SharePoint 2013 it states:

Tuesday, April 24, 2018

I have a PowerShell script which today uses AzureAD commandlets to perform some write operations in Azure AD. This script is to be run on a schedule, and where better to run this than in Azure. It could be as a web job or as an Azure Function.

When running in an app service we cannot use interactive login, but have to use the connect signature below which takes an ADAL app id and a certificate:

Sunday, April 22, 2018

One of the cool features of the new hub sites is that associated sites inherit the navigation of the hub. This means you have one place to configure navigation, and you don’t have to resort to any of the numerous custom solutions out there to solve this. Hub sites makes it very easy to create small hierarchies of sites with a common navigation structure.

A lesser known fact is that the hub navigation also support managed navigation, a popular way to configure navigation since its inception in SharePoint 2013, and something constantly asked for in modern sites.

This post will show that you can achieve it today, but you should probably wait until it’s properly supported.

Thursday, April 12, 2018

Ok, I know InfoPath is not the future and all, but I happen to have one client which has an old InfoPath solution for reporting incidents at their facility. I have previously migrated this from SharePoint 2007 to 2013, which involved some XML manipulation in the process, and I did spare you a blog post on this :-)

Either way, the lists of incidents which goes back years have now been hooked up to PowerBI via the on-premises gateway, so the customer is slowly taking the leap to the cloud.

And, turns out, the date field which has the date of the incident was never exposed as a SharePoint field, a field which is pretty nice to report on for incidents.

I fired up SharePoint designer, promoted the field in question and re-published the InfoPath form. This ensured all new items would have a date in the incident date field, but all existing items were still blank. So how could I in the easiest way possible get the value from the XML files promoted to the SharePoint field? Turns out it was very very very easy.

It was a matter of looping over all list items and running SystemUpdate() on them. This ensured modified date and modified by fields were not changed, but the value got populated.