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)

11
votes
5answers
8k 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 ...
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 ...
8
votes
1answer
333 views

Code editor (IDE) for CSOM developement - Sharepoint

I am searching for a code editor with which I can connect to SharePoint library, like I can open a complete library in the editor, edit, save changes, which will be reflected in the library. ...
6
votes
1answer
59 views

Is context.executeQueryAsync a transactional operation?

I update multiple items in a loop and then call executeQueryAsync() on ClientContext class and this call returns error (failed callback is invoked). Can I be sure that not a single item was updated of ...
6
votes
1answer
193 views

How to copy the entire source folder to target folder within same document library using c# and CSOM?

I want to copy the entire source folder to target folder within same document library using c# and CSOM I've folder structure like in Shared documents/Expenses will be the source folder. the target ...
6
votes
3answers
973 views

Sharepoint asks for log in multiple times

I am using SharePoint 2013. When I log in in my site it asks me to do so 3 times. I think the reason behind it is because I am using two apps, so it once asks to log in into the page and later asks ...
6
votes
1answer
80 views

How to find the last Logged-In time for the external user for a SharePoint online Site?

I need to know about the information for the external user last logged-in time over a site. Is it possible to get through REST or Client-Object Modal?
5
votes
2answers
490 views

Fail to send email by utility class

I have utility class to send email. currently i am facing error :- a recipient must be specified EmailProperties emailp = new EmailProperties(); emailp.To = new string[] { ...
5
votes
2answers
9k views

Get a users Name from their ID

As part of my Sharepoint hosted App i am using a list which contains a Person or Group. I am getting the ID of the person by using the following. var ApproverID = ...
5
votes
2answers
422 views

Uploading a large file to Office 365 via CSOM PowerShell

I have the following code : $FileStream = New-Object IO.FileStream($File.FullName,[System.IO.FileMode]::Open) $FileCreationInfo = New-Object Microsoft.SharePoint.Client.FileCreationInformation ...
5
votes
3answers
169 views

SP Online - Error deleting a site collection using CSOM

I am trying to delete site collections using CSOM script. Below is the code snippet : using (ClientContext tenantContext = new ClientContext(siteURL)) { tenantContext.Credentials = new ...
5
votes
1answer
189 views

Move web to recycle bin using CSOM

I have the code below, that deletes all websites below a specific web. It works fine, but deletes the webs permanently. I want it to move the webs to the recycle bin instead. What do I have to change ...
5
votes
4answers
962 views

SP O365 upload big file via CSOM

Hi I try to upload large files (900 MB) to SP Online (actually the OneDrive Business) but seems to follow SP style. Tried this via CSOM and powershell 70 MB are fine but when I try 900 MB a timeout ...
4
votes
7answers
10k views

SP.js file not loaded in a simple JSOM example

I am creating a simple example that demonstrates client object model using javascript. I have ceated a simple JS file in Visual Studio and an aspx page using the SharePoint Designer. I have used ...
4
votes
2answers
2k views

How to get only custom fields from a list?

I am working with the Client Side Object Model. In a console application I am retrieving all fields from a custom list. The problem is the Clientcontext fetches me a bunch of internal fields I do not ...
4
votes
1answer
535 views

Powershell: Populate a Multi-Value People Picker via CSOM

I'm currently working on a script to update a SharePoint list in a 2013 Dedicated environment. One of the fields on the list is a Multi-Valued 'People Picker' field and I can't figure out how to ...
4
votes
3answers
144 views

Check current user is SharePoint Administrator

Is it possible to check if the current account is a SharePoint administrator? The only way I can think of achieving this is by attempting to login to the https://tenant-admin.sharepoint.com and check ...
4
votes
1answer
569 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 ...
4
votes
1answer
788 views

executeQueryAsync callback with a while loop

I am fairly new to javascript and have spent some time trying to understand callbacks as they relate to SharePoint's CSOM, but have had some issues. Essentially, I am running a query to get a ...
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 ...
4
votes
2answers
72 views

Creating list content type using csom

I am not able to create a list content type using the below snippet. It throws a ServerException with additional information : The site content type has already been added to this list. var ...
4
votes
2answers
311 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.. ...
4
votes
2answers
373 views

Can we access the sharepoint 2013 list from another web application using CSOM

I have to access the sharepoint 2013 list from the site under another web application in the same farm. Is it possible I tried it but, it is not happening. Both the web applications lie in the same ...
4
votes
1answer
83 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
135 views

CSOM combining CAML query with method call (GetWOPIFrameUrl) or two queries on the same instance

I am trying to optimize some code that calls the GetWOPIFrameUrl method for list items that were retrieved using a CAML query. The original code executed the CAML query to get the list of items, then ...
4
votes
3answers
3k views

Send Email from CSOM

Is it possible to send an Email from an Autohosted Sharepoint 2013 app from CSOM code (C#) with an attachment? I have the following code: EmailProperties properties = new EmailProperties(); ...
4
votes
0answers
74 views

First CSOM Program failes

Today I copied the following code from my book to test my first SharePoint-CSOM application, but I cannot get it to work properly: using System; using System.Collections.Generic; using System.Linq; ...
4
votes
1answer
51 views

Site content type changes are not propagated to inheriting list content types

I have the following situation: I've created several site columns en site content types I've created several sub webs with list, inheriting these content types I assumed that if I updated the site ...
4
votes
2answers
185 views

Is it possible to create custom User Profile Properties using CSOM or SPO PowerShell?

I have not been able to find much information regarding creating custom User Profile Properties via CSOM or SharePoint Online PowerShell. Is this possible, and if so, how do I go about doing it?
4
votes
2answers
116 views

SharePoint 2013 - Unique permissions for claims

This is about SharePoint 2013 On-Premise environment. We've a scenario in which certain content is authored in source site collection and published to a target site collection via cross-site ...
3
votes
4answers
106 views

Compatiblity when using CSOM or SOM

If I want to develop an application in .Net using C# which will perform simple operations such as: Connect to a site using user/password Retrieve document libraries Upload file in document ...
3
votes
2answers
174 views

how to get a list's add new item URL with JSOM?

I'm trying to figure out how I can get a list's add new item URL using JSOM in SharePoint 2010. This is what I have so far to get if the current user has edit access on the list. ...
3
votes
2answers
169 views

CSOM - Get root site collection URL

I'm trying to evaluate the position of users, defining whether they come from a site (test.sharepoint.com/sites/site1) or if they reside at the root site collection (test.sharepoint.com). Does CSOM ...
3
votes
1answer
428 views

Recovering a file from the recycle bin

I'm working on a general function to recover an item programatically from a recycle bin via Powershell and CSOM. This is what I have so far, it doesn't throw an error, but it doesn't recover the file ...
3
votes
3answers
1k views

Get Current Login User Profile Properties SharePoint

I need to get current login User profile properties provide information about SharePoint users, such as display name, email, PictureUrl and other business and personal information including custom ...
3
votes
2answers
541 views

Creating site column and add it to content type

I am using the below code Web rootWeb = clientContext.Site.RootWeb; rootWeb.Fields.AddFieldAsXml("<Field DisplayName='Session Name' Name='SessionName' ID='"+new GUID()+"' ...
3
votes
2answers
261 views

Unable to Unregister UserCustomActions added at location scriptlink using CSOM

Below code was used to add Custom action to site <script type="text/javascript" src="_layouts/15/sp.runtime.js"></script> <script type="text/javascript" ...
3
votes
1answer
500 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 ...
3
votes
2answers
109 views

Move or copy a O365 SharePoint subsite

How do you move or copy a O365 SharePoint subsite and all of its children subsites in one site collection to another site collection? I have looked at using PowerShell but it does not seem possible ...
3
votes
1answer
117 views

Send Emails via SharePoint CSOM

I am trying to write a mailsender in C# for SharePoint but each time I start it I get this error message that tells me that it doesn't have permission. I had tried to give it permission at ...
3
votes
1answer
54 views

Creating a contenttype programmaticaly in Sharepoint 2013/Office365

I am looking at the documentation for adding a contenttype via code using Sharepoint CSOM. The example uses a hardcoded ID. foreach (var item in contentTypes) { if (item.StringId == ...
3
votes
2answers
245 views

SharePoint Exception “Value does not fall within the expected range” while creating lookup field using CSOM

I am getting below error while creating a lookup field in SharePoint List (Office 365/SharePoint Online Environment) using CSOM: "Value does not fall within the expected range." Here is my code: ...
3
votes
3answers
386 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 ...
3
votes
1answer
27 views

Updating a UserCustomAction ScriptSrc

I'm trying to update a UserCustomAction that is set on a web. I am trying to update the ScriptSrc url of the action to include a query string parameter, ?rev=1, but it does not seem to be taking. ...
3
votes
1answer
39 views

CSOM: Determine if the List / Library is visible in the UI

I'm new to SharePoint CSOM and I'm trying to get a list of SP Lists/Libraries. Here's my code: public LinkedList<string> getLibraries() { Web site = spClientContext.Web; ...
3
votes
2answers
161 views

SharePoint 2013 list threshold limit

I am trying to access the items of a list that crossed the 5000 limit through C# CSOM. But the list throws an exception as: The attempted operation is prohibited as the list crossed the threshold ...
3
votes
1answer
29 views

Passing password in encrypted form to CSOM model

I want to send the password in encrypted form when creating a new ClientContext object. Is it possible and how? using (ClientContext context = new ClientContext("http://yourserver/")) { ...
3
votes
1answer
78 views

Uncaught Error: Incorrect usage of exception handling scope

I am trying to implement try/catch scope in my JSOM, but I am getting the error message in the question's title. Below is my code: errScope = new SP.ExceptionHandlingScope(context); ...
3
votes
1answer
234 views

list all users in an office 365 site powershell csom

How can I list all the users from an office 365 account. I have tried this: $users = $Context.web.SiteUsers; $userinfos = $Context.web.SiteUserInfoList; ...