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)

12
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 ...
10
votes
2answers
643 views

Which one is faster CSOM or JSOM

Understanding which one has better performance for performing CRUD operation in SharePoint List, CSOM or JSOM?
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
352 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
60 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
252 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
1k 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
96 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
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 ...
5
votes
2answers
591 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[] { "robbstark@...
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 = currentItem.get_fieldValues()["...
5
votes
2answers
499 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
1answer
44 views

Not able to create list from custom list template using CSOM

I am trying to create custom list using a custom list template in csom. My lst get created but it doesn't contain the schema of the list template. It looks like a generic list. Please let me know ...
5
votes
3answers
212 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
218 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
0answers
74 views

How to change list icon of a custom list?

I wanted to change the icon in site content for a custom list in SharePoint Online. Setting the ImageUrl property of the list did the job. But then I discovered that this had also changed the icon for ...
5
votes
4answers
1k 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
11k 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
1answer
611 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
150 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
618 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
886 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
69 views

Disabling tabular view

I have a bunch of views to create for a couple libraries that are all basically the same except for some filter values. I can create them in PowerShell using ViewCreationInformation. After a bit of ...
4
votes
2answers
89 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
397 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
471 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
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
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 ...
4
votes
1answer
108 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
153 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
0answers
77 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
71 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
253 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
1answer
97 views

SharePoint Workflow Subscription Service failed

I have one requirement to start the SP workflow through JavaScript. For this, I have wrote some lines of code to start the workflow. But I am getting a Subscription failed error due to undefined ...
4
votes
2answers
126 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
109 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
185 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
250 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
479 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
1answer
234 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
3answers
2k 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
649 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()+"' Group='...
3
votes
2answers
818 views

How to query more than 100 rows with CSOM?

I have a WPF application I've built that relies on data within a SharePoint list (synced from a website). I believe, perhaps incorrectly that this query will be limited to retrieving 100 rows at a ...
3
votes
2answers
320 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
2answers
385 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" src="_layouts/15/sp.js"><...
3
votes
1answer
598 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(...
3
votes
2answers
3k views

CSOM: Get Url name of list

What is the best way to get the url name of the list using CSOM. For example, we have a list /sites/site/Lists/MyList/ We need "MyList". We could get this, for example by parsing List.RootFolder....
3
votes
2answers
60 views

Can we create List in another site collection using CSOM?

I have a very simple scenario. I am using SharePoint Online I have 2 site collections SC1 and SC2. Now i am executing a JavaScript function in SC1 and am trying to create a list in SC2 in a sub-site ...
3
votes
2answers
129 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 ...