The client-side object model (CSOM) provides access to a subset of the SharePoint Foundation server object model, including core objects such as site collections, sites, lists, and list items and allows you to program against these from client side applications.

learn more… | top users | synonyms (1)

3
votes
1answer
653 views

How to create a list template by using CSOM?

For creating a list template programmatically by using server object, I'm using the SaveAsTemplate() function. SPSecurity.RunWithElevatedPrivileges(delegate { using (SPSite oSPsite = new SPSite(...
12
votes
5answers
9k views

Add Document Library XsltListViewWebPart using CSOM or web services

How to add a document library XsltListViewWebPart (or list view web part) on page using CSOM with SP2013 when we do not want to use the in-built view with "Name, Modified, Modified By" fields? Custom ...
3
votes
1answer
6k views

JSOM - get listitem by file URL

Task Abridgment - Access item attribute from a picture library by picture url. Long - When editing a pagelayout and an image is added to the page, the image's description should be loaded. This is ...
2
votes
2answers
2k views

JavaScript client object model - get current user email id, first name, last name

I want to understand the difference between the following two methods to retrieve the current user email id: Method 1: function getCurrentUserEmail(){ var clientContext = new SP.ClientContext....
0
votes
2answers
536 views

Check an user belongs to a AD group inside SharePoint Group using SPServices JQuery

I want to check the current user exisit in a AD group inside the SharePoint Group using SPServices JQuery. I used the below code snippet but not successed. Any suggestions? $().SPServices({ ...
4
votes
3answers
2k views

Add web part so that we can retrieve it later via CSOM?

How to add a web part on page in such a way that we later on can find it (using CSOM) - Can we somehow store identifier information to the web part? Say user could change the title and description (so ...
9
votes
3answers
2k views

Set request access email address through CSOM

In the server side object model it's possible to set the request access email address through the property SPWeb.RequestAccessEmail (MSDN). Since we are moving our SharePoint tenant to Office365 I'm ...
4
votes
2answers
4k views

Adding ListViewWebPart with CSOM

I have to add a few webparts to a default page using the Client side object model. For the most part this goes fine, I can add a XSLT and content query webparts. However, when i try to add a ...
2
votes
1answer
241 views

Query list for all list items and their attachments using CSOM

I've used the following code to retrieve the list items on my SP site. The following code will return "Value does not fall within the expected range" if I try to get the AttachmentFiles: ...
0
votes
2answers
2k views

List files in a specific folder in a document library

I there anyway to output the files of a specific folder in a document library? Listing them will be like foreach $file in $folder.files { write-host $file.name } But how do I tell it to look ...
4
votes
1answer
138 views

Can we unlock a ShortTerm lock via CSOM for SP2013

We are using SP2013 with OWA installed. Users often complain about a file stored in SharePiont being locked by another user not in office. Error is "The file "xxxx" is locked for exclusive use by ...
4
votes
1answer
681 views

CSOM Search API does not return all the results

I am having a problem with the code below. It is not returning all the rows/items which are found in different lists. The total number of items is 28, but the code below is returning 19. I have set ...
3
votes
3answers
708 views

Query multiple lists using javascript/CSOM

I'm about to query multiple lists using JavaScript (JSOM, SharePoint 2010). It's working when querying one list in a time, but that's annoying when I'm having lots of lists. Working example: ...
3
votes
2answers
5k views

Get Navigation Term for Current Page in CSOM (JavaScript)

I am trying to get the Local Properties for the Navigation Term that is currently being viewed. For example... If I navigate to http://sp2013/about/team I need to get the Local Custom Properties for ...
2
votes
1answer
347 views

Configure custom forms for New and Edit using CSOM

I want to replace the New and Edit forms for a specific list. I have a SharePoint Add-in which has two forms (one for New and one for Edit) and now I want to make sure that when a user click New or ...
2
votes
3answers
6k views

using CSOM to retrieve fields in a list in a view

I am trying to use the CSOM to retrieve all the displayed fields in a particular view. I require to know the field type and field internal name. I can not do: var list = hostWebContext.get_web()....
2
votes
1answer
295 views

How To Create a Picture Library in SharePoint Online(office 365) Using CSOM-JavaScript?

Currently I have created SharePoint Hosted App (Picture Slider) using Napa Office 365 Development tool. So far, I have created picture Library Manually, and now trying to create Picture Library using ...
2
votes
3answers
353 views

Set default value of Article Start Date to [Today] with CSOM

I'm struggeling with setting the default value of ArticleStartDate date-time column using PowerShell and CSOM. Bakground: I have a content type, used by a page layout, inheriting from Article Page ...
1
vote
2answers
255 views

Displaying All sites a User Has access to, Across an Entire Web Application!

I have had this issue for a while, and been asking piece-meal questions for a few weeks. I finally created a full solution that worked. And wanted to provide the full solution, that was both EFFICIENT ...
1
vote
1answer
932 views

Modifying Global Navigation Settings in SharePoint Online

I am working on a PowerShell script to provision a site collection with a predefined hierarchy. Since the PowerShell breadth is so limited, most of this is done via functions that are CSOM code. As ...
0
votes
1answer
431 views

In SharePoint JSOM, how to get a column in the list by name?

The following code will get the list of all the fields in the SharePoint List, however what I m interest in is if a particular field exists or not. function retrieveFieldsOfListView(listTitle,...
4
votes
2answers
506 views

How to get people picker column user login name using CSOM in Powershell?

currently i have ABC list with People column type[Person or Group] i am trying to get user name from column using CSOM in Powershell script for SharePoint Online.. so please suggest some solutions..
3
votes
1answer
85 views

SP2013 - Failed to call, back to back executeQueryAsync() functions

This is exactly what I want to accomplish, given below are the steps I'm performing. Update sub task status based on subTaskId (SP Task List), using executeQueryAsync() Get all sub tasks based on ...
2
votes
1answer
428 views

How to use JSOM/CSOM in SharePoint 2010 to get information about the current user like department, title, manager and phone number

I've seen how to get information about the current user using CSOM/JSOM from Get current user in Client Object Model with javascript? but I can't figure out how to get other properties like: ...
1
vote
1answer
37 views

Returning a SharePoint 2013 termset in a tree structure using CSOM

Is there's a way to Return a SharePoint 2013 termset in a tree structure using CSOM ?
1
vote
1answer
315 views

Using csom search api, how can I search lists based on content types?

I have multiple subsites and each subsite has a list called "Articles". Each has two content types. "News Articles" and "Success Stories". I would like to search based on the content types above using ...
1
vote
2answers
129 views

How can I query a List for different ContentTypes?

I am developing a console application to extract data from a SharePoint 2013 server using the .NET client object model of the SharePoint Server 2013 Client Components SDK: using (var clientContext = ...
1
vote
1answer
92 views

Files move from one library to another library using jsom

Below code is working fine, but inside for-loop if I put alert,then moving multiple file but if I remove, only one file moving. I do not want any alert/pop up. Please suggest. ...
1
vote
2answers
62 views

EventListener for List changes in Sharepoint Hosted app

I'm developing a sharepoint hosted Add-in, which should react to a change of a list field of a list in the hostweb. I need some kind of EventListener for a list field. For example: List field Gets ...
1
vote
1answer
442 views

breakroleinheritance for a folder powershell csom

I am trying to break permission inheritance for certain folders in my document library in office 365. However when $folder.BreakRoleInheritance($false) is executed I get an error: Method ...
1
vote
0answers
1k views

Cross-Domain access limited or not happening

I am having issues connecting to the Host Site of the App, to query a List and obtain information. If i manually navigate to the url, `HostURL/_api/web/Lists/getByTitle('tblTestList')/items?$select=...
0
votes
2answers
76 views

How to get current master page using CSOM

I am trying to get the current masterpage using CSOM. Here is the code which i tried: var context = new SP.ClientContext.get_current(); var web = context.get_web(); var masterPageName=web....
0
votes
1answer
2k views

People search using CSOM API

I am using CSOM in API. I used following code for content search in documents and now want to integrate People search which can search users from sharepoint website using CSOM. MethodResponse<...
0
votes
1answer
31 views

Specified value is not supported for the serverRelativePath parameter

var page = context.Web.GetFileByServerRelativeUrl(FileName); context.ExecuteQuery(); When this is executing I am getting an error: Specified value is not supported for the serverRelativePath ...
0
votes
0answers
128 views

CSOM issue: workaround needed for SystemUpdate & DisableFiringEvents to be able to save current Version to a textfield

To be able to include the current version in Word, I need to have a custom Text field that contains the current version (calculated & Version fields are not available in QuickParts). * The new ...
0
votes
1answer
230 views

SPOnline - Install and *Trust* an App using CSOM

I have a SharePoint Hosted App that I want to deploy to a SPOnline site and trust the App programmatically using CSOM. Idea is to mimic manual installation completely. I tried the below threads and ...
0
votes
1answer
2k views

Could not load file or assembly 'Microsoft.SharePoint.Client, Version=16.1.3912.1204,

Previously I was using Microsoft.SharePoint.Client.dll of version 15.0 in my application. I just removed that reference and added new reference of assembly of version 16.1. But now it is giving error: ...
0
votes
2answers
57 views

How to get ClientContext in CSR?

In a document library's /Forms/AllItems.aspx, I am trying to render a column from ID to a file URL (FileLeafRef). However this line of code: clientContext = new SP.ClientContext.get_current(); ...
0
votes
0answers
100 views

How to use the OOTB SubmitFile ( _vti_bin/Officialfile.aspx) functionality cientside for multiple selected documents?

I have a custom action in the ribbon which execute a javascript function. Inside this javascript I can loop into all selected documents. I would like to implement the OOTB send file functionality ...
0
votes
0answers
104 views

Getting 400 bad request error while doing CSOM GetListItems

I am using the below mentioned code to get data from a list var Totalsum=0; var attr="ows_columninternalname"; function sum1(CamlQuery) { var soapEnv = "<soapenv:Envelope xmlns:soapenv='http:/...