Questions tagged [csom]

CSOM (Client Side Object Model) is a web services-based API of SharePoint allowing easy remote access to data and SharePoint's functions.

CSOM, which stands for Client-Side Object Model, is a web services-based API of SharePoint. It allows access to SharePoint data and features from remote clients. CSOM was introduced in SharePoint 2010 and greatly enhanced in SharePoint 2013.

Both JavaScript and .NET bindings to CSOM exist. Software leveraging CSOM can integrate with SharePoint without the need to run within a SharePoint farm.

In SharePoint 2013 CSOM is the only API available to software built using the new Apps for SharePoint architecture. Apps for SharePoint run side-by-side, typically in the cloud, and integrate with both cloud and on-premise SharePoint farms.

Corresponding MSDN documentation is located here, with separate JavaScript and .NET API references. The web services-based API underlying CSOM has been documented as part of Microsoft's Open Specifications initiative.

941 questions
7
votes
2 answers

How to get users from SharePoint via CSOM?

How can I efficiently grab users (with their properties) from a SharePoint web using CSOM? The code below results in multiple calls to the server (one for each user). It's ridiculously inefficient. Also, is it possible to perform a Filter on the…
Matt Fitzmaurice
  • 1,319
  • 4
  • 19
  • 40
7
votes
2 answers

Sharepoint 2013 - Taxonomy- Microsoft.SharePoint.Taxonomy.TaxonomySession.GetTaxonomySession”

I am updating manage meta data field using C#. Following is code to get TermId for term. string termId = string.Empty; try { TaxonomySession tSession = TaxonomySession.GetTaxonomySession(CC); …
Banng
  • 531
  • 1
  • 6
  • 19
6
votes
1 answer

Difference between PnP Core SDK and PnP Framework

Today I read an article about the two PnP libraries "PnP Core SDK" and "PnP Framework". PnP Core SDK seems to be a framework that is totally abstracting CSOM, Graph or REST Apis of SharePoint/Teams. So I can just use the Pnp-Context and dont have to…
6
votes
3 answers

Create CSOM ClientContext with re-usability like singleton pattern

I have multiple methods being called on different user actions which is using ClientContext. Creating it on every method execution was causing performance issue. So I added it as static variable for re-usability, the performance improved with an…
Amna
  • 603
  • 7
  • 30
6
votes
2 answers

Wrapping a non async-method (which does web calls) into async

I know you should only use async for stuff which is not "CPU-intensive", e.g. file writes, web calls etc. and therefore I also know it doesn't makes sense to wrap every method into Task.Run or something similar. However what should I do when I know…
OschtärEi
  • 2,255
  • 3
  • 20
  • 41
6
votes
1 answer

Javascript csom to access Page Properties

I have some wiki pages in SharePoint 2013 Onpremise "Site Pages" Library. I have created a column "Priority" in the library . I want to access the Page Property from Client Side. I know this is possible from Server side by the following code:…
Godwin
  • 600
  • 5
  • 16
6
votes
1 answer

SyntaxError: Failed to execute 'querySelector' on 'Document': '[object HTMLDocument]' is not a valid selector

I am trying to get all field values from a sharepoint list item on a display template, the ctx.CurrentItem only gets some values but not all I need. I tried the following code, but I get the error on the title SyntaxError: Failed to execute…
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
6
votes
0 answers

using sharepoint OOTB DragDrop.js library in Custom webpart

I implemented drag and drop file upload functionality using REST api in my webpart . But i found an OOTB sharepoint dragdrop.js library which has numerous methods to create drag drop control. Does anyone has an example to create a dragdrop control…
Shekar Reddy
  • 616
  • 7
  • 18
5
votes
1 answer

How to use REST Api or CSOM in .NET 6 client app for Sharepoint on premise

In my SPA with ASP.NET Core backend, I want to create UI for uploading files that will be stored in Sharepoint 2016 hosted on premise. I was just about to use C# CSOM, but it is only available for .NET Framework, not .NET 6. I would use a REST API,…
Liero
  • 25,216
  • 29
  • 151
  • 297
5
votes
3 answers

Upload file chunks to SPS 2013 - Method "StartUpload" does not exist at line

I am trying to upload a large file (1 GB) from code to SharePoint 2013 on prem. I followed this tutorial, I dowloaded from NuGet the package "Microsoft.SharePointOnline.CSOM" and tried this piece of code: public Microsoft.SharePoint.Client.File…
Codey
  • 487
  • 1
  • 8
  • 27
5
votes
1 answer

Powershell CSOM Mutli-Choice Checkbox

I've reached the end of the internet on this. Many variations of this resource technet set_and_get_a_multi-choice_field Im running O365 Sharepoint and I have a multi-checkbox list or multi-select webpart. When I query existing entries, the data…
Autonomic
  • 150
  • 4
  • 15
5
votes
2 answers

Sharepoint CSOM Authentication issue with .NET Core

I'm new to Sharepoint online, and don't have an own account (yet), just an username/password from a client. Need to build a service that gets the folder structure and archives from Sharepoint. And then allows to up/download archives. Since the…
Stefan R.
  • 438
  • 1
  • 5
  • 22
5
votes
3 answers

Get property Type and convert String to corresponding Type

I am using CSOM to update some Task of a Project Server Project. Which property has to be updated is not defined the code finds out dynamically what to update based on the property name as String. For better understanding I wore a simplified version…
user6193206
5
votes
1 answer

SharePoint 2013: How to update multi-value lookup field using JavaScript CSOM

I have a Contacts list which has a multi-value lookup field called ContactType. The result of a CAML query will show the following value for ContactType for one of the list items: 1;#Applicant;#2;#Employee I had a look at Fiddler after executing a…
user1309226
  • 739
  • 1
  • 10
  • 31
5
votes
3 answers

Access denied office 365 / SharePoint online with Global Admin account

I am going crazy since two days solving an issue. The problem is; I am making a console APP which is talking to SharePoint Online using global admin account (One which was specified as admin while making a new subscription). What I am trying to…
1
2
3
62 63