Today, lets take a look at using SharePoint Framework Office UI Fabric. Lets start by creating a SharePoint Framework project. Create a new folder and execute the yo @microsoft/sharepoint command within the folder. If you have not yet set up your workstation for SharePoint Framework you can check out my post SharePoint Framework SpFx SetupContinue reading “SharePoint Framework Office UI Fabric”
Today, we will look at creating a SharePoint SPA using AngularJS and Breeze in a SharePoint hosted app. Single Page Apps or SPA does not mean the application is limited to one page. The experience of navigating between pages is seamless for the user without the postback which happens when navigating to a page. Continue reading “Creating a SharePoint SPA using AngularJS and Breeze”
In this article, we will learn about using AngularJS in SharePoint 2013. Specifically we’ll see how we can do the CRUD operations on a list in the host web from a SharePoint hosted app using AngularJS. Continue reading “Using AngularJS in SharePoint”
The SharePoint 2013 workflow architecture has introduced a workflow manager farm. Workflow manager communicates with SharePoint 2013 using the REST API. Workflow manager requires the user profile application to be already created and configured.
Read on to understand workflows in SharePoint 2013. We’ll go over an example of creating a workflow for a contacts list which creates a task to categorize the contact as Developer, Team Lead or Manager instead of the out of box Approve, Reject options in the task form. Continue reading “Workflows in SharePoint 2013 using Visual Studio”
In this article we’ll see how to plug in some JavaScript and use the JavaScript object model or JSOM to interact with SharePoint. The advantage with JSOM is that it allows you to batch the requests to the server.
In this article, I’ll walk you through the SharePoint 2016 installation on Hyper-V. I used Windows 10 as the Hyper-V host, but you can use any OS which supports Hyper-V. The high level steps are:
Lets say we have a SharePoint Site Page or Application Page which has a server side method and we would like to call this method from JavaScript code. Wouldn’t it be great if we can do the server side processing and return the result such as a string or a json object back to the client side? Well, this is precisely what we can do using WebMethod framework. Continue reading “WebMethods in SharePoint using JQuery”
How to download files from SharePoint document library programmatically using C#
Sometimes, we would want to download multiple files based on a pre-defined query such as a monthly report or a bulk download.
If it is a few files or if it is a complete folder, we can use the explorer view to copy paste the files. However, if we want to customize the query or automate the process, then we need to write custom code to download the files programmatically. This is also true, if we want to access the metadata of the files along with downloading the actual files. Continue reading “Download files from SharePoint document library using C#”
Let us have a look at a SharePoint Framework SpFx example without using any client side framework i.e it uses plain vanilla JavaScript or TypeScript.
In the previous post, we set up the development environment and created a simple hello world web part. If you need to setup your dev environment, you can check out the post – SharePoint Framework SpFx setup. Now, lets examine how to
customize the SharePoint Framework SpFx step by step to retrieve and display some list data.
In the top of the HelloWorldWebPart.ts, we need to import the SPHttpClient and SPHttpClientResponse objects. This will provide us the helper methods to make the REST calls.
import {
SPHttpClient,
SPHttpClientResponse
} from '@microsoft/sp-http';
Lets create couple of interfaces to represent the structure of data returned from the api
In the HelloWorldWebPart class, remove the existing default row provided by the framework and add a new row to load the results. Also, we’ll call a
JavaScript method to load the data. The updated render method looks like
One to query the data
private getListData(): Promise {
return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + `/_api/web/lists/getByTitle('Tasks')/Items?$select=Title`, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
return response.json();
});
}
and a method to load the data to the html
Ensure that you have started the server by running
gulp serve
Now if we navigate to the SharePoint Online workbench and add the webpart, we should see the list of items in the
Tasks list
{sharepoint online site url}/_layouts/15/workbench.aspx
Items in Tasks List
Now we can see the SharePoint Framework SpFx example in the SharePoint online workbench.
Deploy the app
Now lets deploy our SharePoint Framework SpFx example to SharePoint online. Press Ctrl + C to stop the gulp serve
Under the config folder, check the package-solution.json file. You can change any of the parameters such as id,
name etc. You can leave it as defaults for now.
Now, we can package up the solution
gulp package-solution
which will create a package file
helloworld-webpart.sppkg in sharepoint/solution folder
Now we can add this package to our app catalog(Admin center -> apps -> app catalog). If it’s the first time
you are accessing your SharePoint online tenant you need to create the app catalog for this tenant.
Trust App in App Catalog
Once it is added to app catalog, it will list the app and error column should say something like ‘No errors’
App Catalog
Now, lets add the SharePoint Framework SpFx example to the dev site. navigate to the dev site and click the gear icon and ‘Add an app’ and select the hello world web part.
Add an app
Ensure ‘gulp serve’ is running on your local machine again. Now you can go to any page in your site and add this web part.
App added to page
Notice that we are still serving this app from local server. You might get an error if gulp serve is not running
locally.
Deploying the files to Office 365 tenant CDN
Now instead of serving the files locally, we can upload it or host it in the CDN which is given for free by
Microsoft. Let’s go ahead and upload our SharePoint Framework SpFx example package to Microsoft CDN.
Get-SPOTenantCdnOrigins -CdnType Public and we should get back
In the package-solution.json ensure that includeClientSideAssets is set to true.
Let’s package the solution
gulp bundle --shipgulp package-solution --ship and redeploy the package. If the previous local package is already present, it will ask to replace. Click on ‘Replace it’Now, if we refresh our page and go to the console window and check the Sources tab, we can see the files for the SharePoint Framework SpFx example are served
from a public cdn. You can now do a Ctrl + C to end the ‘gulp serve’ on your local machine. The web part will still
work! Congratulations! you have successfully deployed a SharePoint Framework SpFx web part to Office 365 and served the
required files from a public cdn.
In SharePoint 2010, FAST search existed alongside with SharePoint Search. In SharePoint 2013, both have been integrated and you now have a single interface of SharePoint Search.
In this post, we’ll go over some SharePoint 2013 Search concepts such as crawled properties, managed properties. Then, we’ll see how you can customize the search center with Custom result page and navigation, Result Source, Display template, Result type, Query Rules and Refiners.