View Picker Tree view of SharePoint Online and On Prem

If you locking for short cut to integrate SharePoint site hierarchy. The following hack would be a better option if you not willing to custom build control.

✍ How achive?


SharePoint site hierarchy


Azure Functions with SharePoint Online

Common trend we came and interesting figure we came up is moving towards Severless where we are not worry about infrastructure. “Azure Functions” is a compute offering which you allow to write custom logic with choice of C#, F# and JavaScript (as for May, 2017).

From the choices above I have chosen SharePoint CSOM (Client Side Object Model) to this sample but if you prefer JSOM or REST API with the requirement, you could go with those.

Lets checkout Azure Functions with SharePoint Online where both in same cloud group which call as SaaS (Software as a Service).

🛠 Step ♳ – Create an Azure Function

You could arrive there with simply following below reference which is common thing and described in every reference.

🛠 Step ♴ – Adding SharePoint CSOM DLLs

To add SharePoint DLLs to Functions App environment, you required to arrive with Kudu environment.

 Function à Platform Features à Advanced Tools (Kudu)

Shortcut – You could arrive there with URL

https://<function name>

After you arrived with Kudu portal, check for debug then PowerShell (Command prompt is also available but prefer PS). Navigate to bin folder which resides under following location under you function name and upload your SharePoint DLLs to the folder (i.e. Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll)

☕ Learn more on Kudu –

🛠 Step ♵ – Refer SharePoint references on the Function

After adding DLLs to the bin, you could arrive with function and start writing you logic within the run.csx.

You could refer added DLLs in the function as below in the top.

#r “Microsoft.SharePoint.Client.Runtime.dll”

#r “Microsoft.SharePoint.Client.dll”

🛠 Step ♶ – Imports references

This is typical step we are doing in any C# which is adding references.

using System;

using System.Security;

using System.Configuration;

using Microsoft.SharePoint.Client;

🛠 Step ♷ – Configuration Values in Azure Function

You will be required the user name, password, and site URL to your SharePoint, those could be done with the application settings as we were keep doing with the web.config files.

Navigate thorough below path and add your configurations where you will be references in function logic.

Click on Function à Platform Features à Application Settings à App settings à Add values as key/ value pairs

Above could be accessed as below in the code.

string userName = ConfigurationManager.AppSettings[“User”];

🛠 Step ♸ – Application Logic

You could write as your preference. In my sample on the gist which I have posted below is considered copying list items from one list to another. It’s really simple and you could able to expand the logic as you have done earlier with SharePoint CSOM.

⌛ Motivations

You could use Azure Functions as Timer Jobs (which we had in SharePoint Server) with scheduling and web hooks and etc.

References – Azure Function Developer Guide

Enabling External Sharing | Multidomain Sharing in SharePoint Online

In SharePoint online environment most of the businesses facing issue with connecting with another business (B2B) or in technical terms connecting with another domain.

We have been using different methods with the Active Directly level which we known as “Federation”. But will see how we could share SharePoint site with multiple domains.

📓 Note : 

  • You must have either Microsoft account or organizational account to achieve this. 
  • Microsoft account must not be Live, Outlook or Hotmail, It could be Gmail, Yahoo or another. Then you should create a Microsoft account with your domain. Eg. “”.
  • Organizational account is account in another Office 365 tenant

How to share site with external domain user?

Firstly, you must enable External Sharing in the Office 365 admin center. This could be find easily with searching external sharing in the admin center.

ext 1

Second, Go site administration and select your SharePoint site and hit on “Share” on the ribbon. Make sure and best practice 🔖 to mention your external domain you sharing as below.

ext 2

Finally added user will be visible as below in the Office 365 admin center.

📌 Some useful resources :

In memory of Office SharePoint Server 2007 aka MOSS

Naturally we all expect end on everything, same applies to software in this days. Hopefully we could not see SharePoint 2007 living with us for ten years as for now after 10th October 2017, in a way This is with the good hope on modernize and evolve with the collaboration but in a way bad news for whom love classics.

What happens after deprecation?

  • No security update further
    • This will get managing this costly
    • No patches No hot fixes from Microsoft
  • No support
    • Need to migrate to version with life as sooner
    • Not guaranteed Office365 and cloud support
  • No technical content management
    • Less documentations and resources
    • Less community engagement

Key milestones to say good bye!

“Say good bye and make your modernization plans switched on”

REST and OData with Office365 APIs

When communicate with Office or SharePoint APIs, its important fact that knowledge on representational transfer protocol and OData protocols while moving with deep customization’s.

what is REST (Representational State Transfer)?

In simple terms REST is all about below;

  • Predefined set of stateless operation which identified by URL
  • Responses may contain HTML, JSON, XML or any other defined format which supported
  • GET, POST, PUT, DELETE are most common forms of HTTP verbs




what is OData (Open Data Protocol)?

  • Equipped with query and creational capabilities on REST APIs
  • Initiated by Microsoft in year 2007
  • Format [http or https]://<REST Endpoint URL>/<query>
http://<end point URI>?$select=value&$filter=condition$orderby=value

Open Standardization?
Standards which are developed with the involvement of community (mostly with developers). Open standards inherited to office 365 API development in following manners;
• Most of Office 365 APIs are exposed as a RESTful APIs
• Its implemented with OData 4.0 (as for year 2016)

OData queries?
OData queries is common standard which elaborated above also included in the SharePoint and Office365 end point data querying. Its ultra simple if you know the basics and played with this. Follow the following links and be expert on this. : Official site for OData : Explore Microsoft Office365 API with queries

OData validator to validate your REST endpoints

Note : If you noticed there are versions associated with most of cloud based endpoints. Cloud services are continuously pushing changes to its services as sooner changes are ready, so then returned patterns may changed for same query. To avoid custom applications get break due to changed on endpoint, it classifies under version metadata. Simply you can pick any version which satisfies your requirement.

Querying SharePoint Endpoints as below;

SharePoint REST service query option syntax
Courtesy :


Further references 

Integrate SharePoint Documents with Office Web Apps in Custom Solutions

If you are finding way of integrating Office Web Apps(OWA)with your custom solution which built with SharePoint CSOM/ JSOM or with integration of any client site development. Specially in a scenario where you develop your own “SharePoint display template” following integration points will be useful;

View in office web apps

Following link will work; if your requirement is to open your document in OWA. This can be done with simply appending parameter as below;

<uri to your document>?Web=0


Edit SharePoint documents in OWA

Following way of integration with the Office Web apps which let you to pick your action is; means that whether your action may be read, edit or your default setting.

<Web absolute URi>_layouts/15/WopiFrame.aspx?sourcedoc=<Relative URi to document>&action=<Your action>

Summary of actions as below;


&action=default -> Gets default setting of the documents
&action=view    -> Open office app as a read only
&action=edit    -> Open office app as editable



You can be changed the default behavior with following approach

Building URL to the Office Web Apps

If you thinking about how to build your URL; following illustration may be useful.

var owauri="_spPageContextInfo.webAbsoluteUrl" //absolute URL of the SharePoint site
+"/_layouts/15/WopiFrame.aspx?sourcedoc=" //static phrase
+"/sites/OWASite/Documents/TechCentro.docx" //Relative URL to the document
+"&action=edit //Action parameter

Useful resources

[Improved Post] Update SharePoint Metadata (Taxonomy) column with Angular JS

After earlier post on the same topic which is updating taxonomy (managed metadata) column with Angular and with JSOM. Thought of optimize the code with more readable and with JavaScript promises. There may be areas further to be improved, for now sample code as below;

(function () {
 'use strict';

 // define controller
 var controllerId = "MMSDevCtrl";

 .controller(controllerId, ['$q', mmsDevController]);

 // create controller
 function mmsDevController($q) {

 //global var
 var vm = this;

 //value definitions
 var siteUrl = 'http://win2012/sites/MSSDevTest';
 var listName = 'MyDocumentLibrary';
 var fieldName = 'MMSDepartments'; //MMS Column one
 var fieldName2 = 'MMSDevLanguages'; //MMS Column two
 var itemIdUpdating = 1; // Item to be udated
 var termLabel = 'IT'; //'';
 var termLabel2 = 'Java'; //'';
 //add metadata column to sharepoint
 vm.submitMetadata = function () {
 // function for update managed metadata column

 // Setting managed metadata to SharePoint List or Library
 function SetManagedMetaDataField() {
 var context = new SP.ClientContext(siteUrl);
 //Get item form ID
 var list = context.get_web().get_lists().getByTitle(listName); //listName
 var item = list.getItemById(itemIdUpdating); //itemID
 //MMS columns
 var field = list.get_fields().getByInternalNameOrTitle(fieldName); //Tx field one
 var txField = context.castTo(field, SP.Taxonomy.TaxonomyField);
 var field2 = list.get_fields().getByInternalNameOrTitle(fieldName2); //Tx fieldName two
 var txField2 = context.castTo(field2, SP.Taxonomy.TaxonomyField);

 //loading context

 //excute async of context
 , function () {
 //Getting term set IDs of the fields
 var termSetId = txField.get_termSetId().toString();
 var termSetId2 = txField2.get_termSetId().toString();

 //Getting ID for term
 getTermIdForTerm(context, termLabel, termSetId)
 .then(function (termID) {
 console.log("Returned term Id", termID);
 //check for not multi valued taxonomy column
 if (!txField.get_allowMultipleValues()) {
 var termValue = new SP.Taxonomy.TaxonomyFieldValue();
 txField.setFieldValueByValue(item, termValue);

 getTermIdForTerm(context, termLabel2, termSetId2)
 .then(function (termID) {
 console.log("Returned term Id 2", termID);
 //check for not multi valued taxonomy column
 if (!txField2.get_allowMultipleValues()) {
 var termValue2 = new SP.Taxonomy.TaxonomyFieldValue();
 txField2.setFieldValueByValue(item, termValue2);

 // Define other columns to be updated
 item.set_item('Title', 'New Item 9102016 C');
 // Update item
 //Execute query for update
 function () {
 console.log('field updated with MMS column #TechCentro');
 }, function (sender, args) {
 console.error(args.get_message() + '\n' + args.get_stackTrace());
 , function (sender, args) {
 console.log(args.get_message() + '\n' + args.get_stackTrace());
 , Function.createDelegate(this, function (err) {
 // Getting ID of the Term
 function getTermIdForTerm(clientContext, termValue, termSetId) {
 var deferred = $q.defer();
 var termId = "";
 var tSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext);
 var ts = tSession.getDefaultSiteCollectionTermStore();
 var tset = ts.getTermSet(termSetId);
 var lmi = new SP.Taxonomy.LabelMatchInformation(clientContext);
 var termMatches = tset.getTerms(lmi);
 //context loading with taxanomy values
 function () {
 if (termMatches &amp;&amp; termMatches.get_count() &gt; 0) {
 termId = termMatches.get_item(0).get_id().toString();
 console.log("Resolved Term Id for Term " + termValue, termId);
 }, function (sender, args) {
 console.log("Error on retrieving term GUID", args);
 return deferred.promise;



Markup as below;

<script src="../../_layouts/15/SP.Runtime.js"></script>
<script src="../../_layouts/15/SP.js"></script>
<script src="../../_layouts/15/SP.Taxonomy.js"></script>
<script src="../Scripts/angular.js"></script>
<script src="../Scripts/App.js"></script>
<script src="../Scripts/mmsDev.controller.js"></script>
<div ng-app="app" ng-controller="MMSDevCtrl as vm">
<input id="Text1" type="text" ng-model="vm.value"/>
<input id="Submit1" type="button" value="submit" ng-click="vm.submitMetadata()"/></div>

Click here to view old post.