Posts

Showing posts with the label SharePoint Apps

Filter with NULL value using REST API in SharePoint

$filter=FIeldName ne null url: _spPageContextInfo.webAbsoluteUrl+"/_api/Web/Lists/GetByTitle('Products')/Items?$select=Name,Price,Size&$filter= Size ne null ", The above URL returns the items not having Size field value as Null . ne - Not Equal                     

Create a Folder in Document Library Using Client Object Model (CSOM)

Here, I demonstrated how to create a floder in a document library using CSOM Example code for CSOM: using System.Collections.Generic ; using System.Linq ; using System.Text ; using System.Threading.Tasks ; using Microsoft.SharePoint.Client ; using Microsoft.SharePoint ; namespace FolderCreation { class Program { static void Main ( string [] args) { ClientContext context = new ClientContext( "http://win-pi0rfb9adj8/sites/Home/" ); Web oWeb = context.Web; List oList = oWeb.Lists.GetByTitle( "Give your library" ); ListItemCreationInformation oCreationInfo = new ListItemCreationInformation(); oCreationInfo.UnderlyingObjectType = FileSystemObjectType.Folder; oCreationInfo.LeafName = "Approved" ; ListItem oListItem = oList.AddItem(oCreationInfo); oListItem.Update(); context.ExecuteQuery(); } } }

Create a Folder in Document Library Using Javascript

Image
Here, I demonstrated how to create a floder in a document library using Javascript Example code for JSOM: 1. Open Default.aspx page. 2.Add a button to create a folder. <button id="btnFolder" onclick=" floderCreation ()">Click Here</button> 3.Open  App.js file and below code 'use strict' ; var context = SP.ClientContext.get_current(); var hostweburl; var appweburl; $( document ).ready( function () { hostweburl = decodeURIComponent (getQueryStringParameter( "SPHostUrl" )); appweburl = decodeURIComponent (getQueryStringParameter( "SPAppWebUrl" )); }); function folderCreation() { var ctx = new SP.ClientContext(appweburl); var appCtxSite = new SP.AppContextSite(ctx, hostweburl); var web = appCtxSite.get_web(); var list = web.get_lists().getByTitle( "Documents" ); var folderCreation = new SP.ListItemCreationInformation(); folderCre