Tuesday, May 24, 2016

Workaround to filter on taxonomy columns using OData filters instead of CAML using REST in SharePoint


Wow, that was a long post title indeed. The thing is, you cannot use OData filters on taxonomy columns in SharePoint, hence you see posts on the interwebs about using CAML instead to filter on taxonomy fields by using this construct:


And this works just perfect. But if you try to add a field expansion at the same time on a lookup field, then it blows up. So you can either do an $expand=MyLookupFiled on the /Items endpoint or filter using CAML on a taxonomy field using the /GetItems endpoint.

What if I told you that you can accomplish both using a workaround!! You may either contact me and pay up, or continue reading for free :)

Monday, May 23, 2016

Diagram on adding a new content source in SharePoint

Looking for a Visio file I discovered this one which I forgot to publish some time ago. So here’s a small diagram you can use when adding a new content source to cover the most important aspects you need to think about when adding it.

There are more complicated scenarios of course, and feel free to reach out if you have any questions.

Friday, May 20, 2016

Appending query terms to a search URL


I have written about appending query terms before without having them in the search box, and I’ve missed out at the best approach for this until now. Sometimes it takes years for the obvious solution to step forward.

In SharePoint 2010 you could add a= to a query and the terms on the a parameter would be included in the query as a hidden constraint. So how best to do something similar in SharePoint 2013/2016 or SharePoint Online? You modify the query template!!

A simple query template like {searchboxquery} {?{QueryString.a}} will take the value of the a parameter and append it to the query. Problem solved, and you can keep existing code if you migrated even.

Craft a query like: https://contoso.sharepoint.com/search?k=foo&a=title:bar and the query will filter to items where title includes the term bar, but not show it in the search box.

Wednesday, May 4, 2016

Introducing SharePoint Framework!

Today Microsoft announced SharePoint Framework, the framework which will take SharePoint web development into 2016. At last, client side development has become a first class citizen of SharePoint development, and developers can use the open source framework of their choice like React or AngularJS to develop web parts, pages and views in SharePoint like there was no tomorrow!
Want to read more? Take a peek at my article on Puzzlepart.com and see a demo of what I’ve built using this new framework being part of an early test group. Or head over to the official Microsoft blog post.

Monday, May 2, 2016

Hello, it is you we are looking for!

imageAre you an opinionated gutsy person in the Oslo, Norway area with at least some work experience who want to work with Office 365 and SharePoint? Maybe you should get in touch with Puzzlepart, ‘cause we’re hiring!

We’re a mix of nutty, crazy and passionate people, so if you love having fun at work while also delivering real business value feel free get in touch.

You’ll find my contact information in the right column of this blog :)

Thursday, April 28, 2016

Search your internet site via Bing in SharePoint

I’ll credit this post to Dean Gross who did the legwork, and builds on my previous post about showing external RSS feeds in SharePoint via Search. If you want proper rendering of the results make sure to visit the post.

You might want to list some internet results on your SharePoint pages, and you can do this creating a new OpenSearch result source targeting Bing which supports RSS as a return format of results.

Create a new Result Source at the level of your choosing, set it to use OpenSearch 1.0/1.1 as the protocol and paste this URL in the Source Url field:

http://bing.com/search?q=site:techmikael.com {searchTerms}&count={itemsPerPage}&first={startItem}&mkt={language}&format=rss

The above URL will lists items from this blog.


Drop a content search web part on your page using this result source and you are good to go!

If you’re not passing in a search term yourself, remove {searchTerms} from the URL.

Setting up Azure Business to Business (B2B) access for use with SharePoint Online

SharePoint Online’s support for sharing sites and documents with external users has been there a while now, but sharing with each individual users is quite cumbersome if you have to share with a volume of users. This is where Azure B2B comes into play, and the Azure team has good information on this over at Github.
Steps covered in this post:
  • Create AAD security group
  • Enable external sharing in a site collection
  • Add AAD security group in the site’s Members group
  • Create and upload CSV file with all external users to AAD
  • Accept invitation and have bliss!

Search behavior of automatically created managed properties

When you create site columns in SharePoint they will have automatically created crawled and managed properties created for them. The naming convention for the properties is explained in detail at TechNet, but it doesn’t mention what properties are set for the associated managed properties.

As far as I know this is the behavior:

  • All managed properties are set to retrievable
  • All managed properties are set to queryable
    • except multi-line and pub image/html/link fields
  • Taxonomy fields are also set to searchable (which makes no sense what so ever to me)

Thanks to Graham Sheeley for the idea for this post :)

An approach to cleaning up search schema changes in a site collection

Graham Sheeley posted a question in the Search Explained Yammer network about how to undo search schema changes at the site collection for SharePoint Online (which also applies to on-premises).

The difficult part here is to know what changes have actually been done to the schema so you can undo them. There is no magic undo button, but here’s a working procedure to remove any unwanted changes.
  1. Go to site settings for your site collection
  2. Click Search Configuration Export below Site Collection Administration
  3. Open the exported xml file in your favorite text editor, as this file will contain only the changes made at the site collection level
  4. Look for the SearchSchemaConfigurationSettings node
  5. In the ManagedProperties nodes you will find new managed properties which have been created, in the image below a new one named MikaelKnowsHisStuff
  6. Re-crawl content to weed out values from the index
If you have made mappings to existing managed properties you will see these listed in the Mappings node and have to examine and possible compare with a blank site to see which have been added or removed.

Unfortunately it’s not a simple undo operation, but at least possible. This is also why I strongly advocate to re-use the reusable managed properties for your custom use, as it’s quite easy to see any mappings done in the UI, as long as you know which ones might be globally mapped.


Wednesday, April 27, 2016

Gotcha when administrating multiple MMS’ in SharePoint


If you create more than one managed metadata service in SharePoint and want to enter one of them via Central Admin, make sure BOTH are checked off as available services for the Central Admin web application. If only one is selected, then clicking either MMS will take you to the one assigned to the web application.