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)

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; ...
1
vote
1answer
30 views

Making sure nobody (but the add-in) can access a list

I create Lists inside the app-web of a provider-hosted-app(-addin) using CSOM: All access to that lists should only be done by the addin itself and not by the user. So I want to make sure nobody can ...
2
votes
2answers
190 views

IE Error DOM7009: Unable to decode image at URL

I am working on a SharePoint App. In my app parts I have used a few images. All the images are showing up properly in Mozilla and Chrome but a few of the images are not showing up in IE, I can only ...
0
votes
0answers
70 views

How Can I copy Publishing Pages & Site Pages with WebParts to another site collection in SharePoint Online?

I am looking for a solution which can help me to copy Pages (Publishing, Site etc..) from one site collection to another site collection in SharePoint Online. To meet this requirement I have tried ...
0
votes
0answers
13 views

Is it possible to query users who have alerts/subscriptions for a list?

Using the CSOM or REST API is it possible to query for users who have subscribed to alerts for a list? I attempted to Google it but didn't come up with much. Thanks!
1
vote
0answers
40 views

Accessing Sharepoint through CSOM

I am trying to access a project SharePoint 2010 site using the below code using (ClientContext _clientContext = new ClientContext("https://xxx/proj")) { _clientContext.AuthenticationMode = ...
1
vote
0answers
41 views

Create a custom permsetup.aspx and add extra text fields for new groups

I have the following requirement: When a user creates a new site via Site Settings\Site Content\New Subsite, and he selects "use unique permissions", the user is redirected to the page: ...
0
votes
0answers
29 views

ListItem.Update is updating only one column in a row?How to update the complete row

I am adding an items in a list from excel . It is adding rows but the value is inserted in only one column of each row.Below is the code foreach (DataColumn header in dtExcel.Columns) { if ...
1
vote
1answer
86 views

Delete 18 million items from workflow history list

I need to delete the content of the workflow history list that has 18 million items. I've tried the CSOM code below but it throws a time out error. I couldn't index any columns either through list ...
0
votes
0answers
37 views

Use CSOM Search API in app part to search across site collections

I'm not sure if I've asked the question correctly, so hopefully it isn't misleading. But basically what I'm doing is completely writing my own search page using the CSOM. In general, I have less ...
0
votes
0answers
29 views

How can I access promoted results using CSOM?

I am basically rolling my own search center using CSOM (because...I need the control to make this thing look decent!). How do I use all the query rule stuff with CSOM? There doesn't seem to be a ...
1
vote
1answer
178 views

SharePoint online c# csom download file

Hi I am having a requirement to download files from doc library using c# console app. the below is the code I use. ClientContext context = new ClientContext("https://siteurl"); ...
2
votes
1answer
56 views

How to get parentlist of a lookup column in CSOM

What I want is this using (Web web = lookup.ParentList.ParentWeb.Site.OpenWeb(lookup.LookupWebId)) { List list = lookup.r.LookupWebId.LookupList; Field ...
0
votes
1answer
18 views

Sharepoint hosted app to replace search center

So I've finally got the search CSOM to give me results back in my sharepoint hosted add-in/app. I can install/deploy it out, I can even add it to our catalog. I can then add the app in the site ...
4
votes
3answers
143 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
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 ...
0
votes
0answers
24 views

Connect to a SharePoint 2010 site having SSO authentication using Powershell

I am trying to connect to a SharePoint Site having an SSO authentication using PowerShell. But i am unable to do so. Please note, I am trying it from an external server so i have to do it using ...
1
vote
0answers
59 views

Add WebPart to Page with PowerShell

So I have the following code that I took from "http://adicodes.com/adding-web-part-to-page-with-powershell/". It works fine, until the $context.ExecuteQuery() in the AddWebPartToPage function, where ...
1
vote
2answers
52 views

Copy Taxonomy Field from one item to another

I use CSOM and I want to copy a taxonomy field from one list item to another. Can someone give me an example of this?
1
vote
1answer
55 views

Check if site exists SharePoint Online and can access non admin account

Is it possible to check if a sites exists using a non admin account. I would like to check if a site exists and even better, check if I have access. I know how to do this querying the sharepoint ...
1
vote
2answers
55 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
54 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
14 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
55 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
25 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
70 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
37 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
55 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
49 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
23 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
60 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
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 == ...
0
votes
2answers
104 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
38 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
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; ...
0
votes
1answer
46 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
53 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
44 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
244 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
155 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
27 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
44 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
30 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
39 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
240 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
110 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
87 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
101 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
45 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 ...