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)

1
vote
2answers
37 views

Unable to access a list in a different farm using client context(CSOM). The remote server returned an error: (401) Unauthorized

I am trying to access a list in a site collection of different farm using CSOM. But I am getting the error: The remote server returned an error: (401) Unauthorized." Code I used is below. ...
3
votes
0answers
50 views

How to set HTML field security using CSOM

Is there a way to set the HTML field security using CSOM? I already found a way to use PowerShell Scripts but i wondering if there is also a way to use CSOM. PowerShell: ...
1
vote
0answers
13 views

how to find custom permission levels

How to find permission levels that are created by user for a site? i.e other than default permission levels. I want to use CSOM. Do anyone have idea about this?
3
votes
2answers
48 views

Get User Properties (personal site) without admin permissions

Is possible to get a users personal site information from this endpoint /_api/sp.userprofiles.peoplemanager/getpropertiesfor or by another means without having admin rights? I need to be able to get ...
2
votes
0answers
21 views

Site Visits returns zero

I am using CSOM to retreive data for SiteCollection Usage(SharePoint 2010 and 2013). My code is below: Site site = context.Site; Web web = context.Web; ...
0
votes
1answer
51 views

getting 1 item from a list with specific fields using c# csom

Hi Guys i'm trying to retrieve a specific item from a SharePoint list using CSOM. I can get the item but im not sure how to specify multiple fields. var Web = context.Web; var ...
0
votes
2answers
32 views

CSOM not retreiving count of items in a list

I'm trying to get a count of specific items in a SharePoint 2010 list but I keep getting a count of ALL the items in the list. Here is my code: var clientContext = null; var web = null; ...
2
votes
1answer
46 views

Access a list of all the installed features on a site using javascript

I am trying to find a list of all the features on my SharePoint 2013 cloud site using JavaScript. When I get the context to the site I don't see FeatureDefinitions as part of the site object ...
0
votes
1answer
38 views

Include all non-system fields for listItems from client-side

Usually for retrieve information from list without system fields we've use code like this: clientContext.Load(logWorkItems, items => items.Include( item => item["Hours_x0020_spent"], ...
0
votes
0answers
18 views

SharePoint Online PowerShell Custom Group in Site Settings

I know how to use PowerShell to create a new SharePoint Site Settings link, but I cannot seem to find how to create a custom group within site settings. Here is the code for creating the Custom ...
1
vote
1answer
48 views

Filter out hidden folder using client object model in SharePoint 2010 / 2013

I need to do the same thing as on this thread: Filter out hidden folder using client object model in sharepoint 2013 However my code needs to run on SharePoint 2010 and Sharepoint 2013. I'm using the ...
3
votes
1answer
51 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 == ...
0
votes
2answers
85 views

how to retrieve all surveys in my site using javascript/csom

I have created some surveys using survey app,I want to list all surveys existing on my site using client object model.
0
votes
1answer
34 views

How to Access Provider-Hosted App programmaticly

I have a (working) provider hosted app that mainly acts as a REST-Service (MVC5). I want to unit test my Rest-Controllers but can't find out how to give the right credentials. I already got the URL ...
3
votes
1answer
38 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; ...
0
votes
1answer
44 views

How to add SiteCollection Administrator in SharePoint 2010

How to add SiteCollection Administrator in SharePoint 2010 using CSOM(c#)? 'IsSiteAdmin' property is not available for SharePoint 2010. Can I accomplish this by updating "isSiteAdmin" field value for ...
0
votes
1answer
40 views

How do you know when to call ClientContext.Load in managed CSOM

I'm reading a book on app development called "Microsoft SharePoint 2013 App Development" (yeah I know its getting old) and I simply can't wrap my head around the use of ClientContext.Load. An example ...
1
vote
1answer
42 views

HTML Webpart JavaScript works in EditForm.aspx but won't in AllItems.aspx

I have a HTML Webpart with the following code (piece): <script type="text/javascript" src="../../SiteAssets/jquery-1.12.0.min.js"></script> <script type="text/javascript" ...
2
votes
3answers
196 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 ...
0
votes
0answers
13 views

Performant way to do a count on a sharepoint-list using CSOM?

I need to get only the count of a Caml-Query from within SharePoint (2013/O365) I retrieve the data the following way: private int GetCount(ClientContext clientContext, CamlQuery query, string ...
3
votes
2answers
129 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 ...
1
vote
0answers
26 views

Create enterprise wiki page with embed code

We are looking at migrating our very old ScrewTurn Wiki into SharePoint 2013 Enterprise Wiki site. One key features in the original system is the inline PDF viewing with html embed object. I was ...
2
votes
1answer
41 views

Get users in group using CSOM or SharePoint default webservices

Background I had developed a client solution1 for SharePoint Online for query certain info from users (i.e: AccountName, PreferredName, Picture, etc) and show the obtained info in a page where the ...
0
votes
0answers
28 views

Get only visible Fields from Query?

I use a simple CAML-Query to retrieve the contents of a list inside the Appweb. (But this isn't app-specific) camlQuery.ViewXml = ...
1
vote
1answer
37 views

retreive SiteCollection Secondary Administrator using CSOM

I am unable to retrieve "secondarycontact" value from Site object. I am using client dll v16.0.4002.1211 against SharePoint 2013. my code is here : ClientContext context = new ClientContext(siteUrl); ...
3
votes
2answers
180 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: ...
1
vote
1answer
78 views

Upload a Folder with Sub-folders and Files Recursively with Pure CSOM?

Can someone please, share a CSOM (C# only) recursive method for uploading a folder with subfolders and files to a SharePoint Online Library? I know about WebDav and FileExplorer, but it's not a ...
2
votes
0answers
72 views

Rest API calls from provider hosted apps

Here is the scenario. We have a product built on linux systems and the data is available through REST API. The web application which is built on JAVA is also hosted on the same environment. Few of ...
3
votes
1answer
96 views

Unable to get list using CSOM on SharePoint 2013

I'm trying to get a list using CSOM in a SharePoint 2013 that was migrated from 2010. This is the code that I'm using, and it is working in all my environments except this one. function ...
2
votes
0answers
43 views

Can't apply filter [ME] to person field updated by CSOM

I create calendar item and add user field value by SharePoint CSOM. Item successfully created but I can't apply [ME] filter to person field. Returned no results. But if I open item to edit and save ...
2
votes
1answer
224 views

Get user permissions using CSOM

For SharePoint Online, I am trying to get user permissions on a site, including library, folders and files, using CSOM. I have the following code: ClientResult<BasePermissions> info = ...
4
votes
1answer
46 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 ...
0
votes
1answer
56 views

Search display template for special column types like Person or Group

I have lists of a special item content type that I list using search. These list contain for instance a column of type Person or Group. In the lists the columns are being displayed as "Name (with ...
2
votes
2answers
76 views

CSOM get document by ID

I'm using the following CSOM code to retrieve a document title by id: ClientContext context = new ClientContext("http://sharepoint"); List oList = context.Web.Lists.GetByTitle("Documents"); ...
0
votes
0answers
74 views

SPservices GetListItems giving 400 bad request error

I am using the below mentioned code to retrieve a column value from a list and calculate its sum. The below code is giving a 400 bad request error. function sum (attr,CamlQuery,BA) { ...
0
votes
0answers
56 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 ...
2
votes
1answer
56 views

Retrieve List/Library “Shared With” Users and Groups using Javascript

I can retrieve Shared With info from a SharePoint 2013 (On Premisses) List/Library (not an item) using Javascript? I thought it could be available through ...
1
vote
0answers
19 views

Remove users and their MySite using CSOM

I have a scenario in which I have to remove the users from SharePoint after they have left the company. Say, I have 5 users who left the company. So I'll write a CSOM code to read the names from a ...
1
vote
0answers
33 views

How to access subsite's groups with sitecollection context?

I have two sub-sites in my sharepoint site,SampleSite1 and SampleSite2 under Sitecollection called MainSite. http://xyz.sharepoint.com/sites/MainSite/ - SiteUrl ...
2
votes
0answers
49 views

How to update the Microsoft.SharePoint.Client.File object Author and Editor property after successful upload

I am trying to update the Microsoft.SharePoint.Client.File object Author and Editor property after successful update. below code I have written for that. foreach (Attachment att in attachments) { ...
1
vote
0answers
19 views

CSOM: Add app to web that is present in organization app catalog

I need to install Apps to a web programmatically using CSOM. Apps are already added to the App Catalog of the tenancy. Is it possible? I am aware of LoadAndInstallApp API and it works but requires ...
3
votes
1answer
28 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/")) { ...
0
votes
1answer
48 views

404 Missing jQuery in _layouts folder

I have been stuck for a while trying to find out what exactly the _layouts folder does for SharePoint and why it may be causing any script I write and attempt to deploy on the site to not work. They ...
3
votes
1answer
79 views

Get document ID with CSOM

I'm using the following code to get a document via its documentid in a ASP MVC application: ... // Get Document ID ctx.Load(uploadFile, f => f.ListItemAllFields); ctx.ExecuteQuery(); documentID = ...
2
votes
2answers
32 views

Where are the sharepoint 2010 client assemblies

I am wondering where I am able to download the sharepoint 2010 client assemblies (the ones located in folder 14)
1
vote
2answers
46 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 ...
0
votes
1answer
30 views

What permissions are needed to create new TermGroup in Default Termstore?

To add a taxonomy-Column to a List I try to add a new TermSet in the default Termstore. This is the code: TermStore termStore = session.GetDefaultSiteCollectionTermStore(); ...
3
votes
3answers
120 views

Cannot contact site at the specified URL on try ClientContext.ExecuteQuery();

I try to get list from remote SharePoint server using CSOM in .NET Web Application, but ClientContext.ExecuteQuery() return exception Cannot contact site at the specified URL If I try to get ...
0
votes
0answers
13 views

JSOM column creation in host web doesnt work

I get an error (the error message is empty but it doesnt work) with this script for creating a column on a SharePoint host web. <script type="text/javascript"> var clientContext = new ...
2
votes
0answers
31 views

Desktop application needs to support all versions of SharePoint and SPO

I am connecting to the different SharePoint environments using the CSOM. Whats the best way to deploy the available DLLs to support all SharePoint environments? Do I need to dynamically instantiate ...