Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [csom]

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
39 views

Typescript custom action deploying banners with SharePoint 2019 list item data

I have a HelloWorldApplication which is in a development environment using gulp serve as the deployment. I am able to deploy the solution to a page, which renders banners on the top and bottom of the ...
Alexander Lange's user avatar
0 votes
0 answers
15 views

How would I retrieve the PropertyBag of ListItems using the RenderListDataAsStream API?

Our customer has rather large lists and libraries in their SPO environment and we need to query a property bag entry from all list items of those large lists. Currently, we're successfully using the ...
NinjaSquirrel's user avatar
0 votes
0 answers
9 views

Using PnP.Core with windows app and MFA

I have a new windows app running on 8.0. I need to upload some items to a SharePoint Online list. But I cannot find any samples for a windows app and connection using MFA? Any pointers or do I need to ...
Thomas Segato's user avatar
0 votes
0 answers
33 views

SharePoint ServerUnauthorizedAccessException: 'Attempted to perform an unauthorized operation.'

i cannot load Web from SPO using Context.ExecuteQueryAsync, i receive alayws the same error Microsoft.SharePoint.Client.ServerUnauthorizedAccessException: 'Access is denied. (Exception from HRESULT: ...
tounsi amir's user avatar
0 votes
0 answers
20 views

Updating multiple managed metadata columns in a single update

We're working on a job to sync some data to SharePoint 2019 using CSOM. private static void SetLookupsItemValue(ClientContext context, List list, IEnumerable<Column> lookupColumns, ...
Nbloom's user avatar
  • 1
0 votes
0 answers
13 views

How to obtain ChangeItem data from the response

I'm trying to fetch all the site changes that occur within a specific interval by giving a ChangeTokenStart. My implementation is the following: var changeQuery = new ChangeQuery(true, true) var ...
john_boy's user avatar
0 votes
0 answers
15 views

SystemUpdate() causes "Attempted to perform an unauthorized operation."

I need to use ".SystemUpdate()" inside Azure Function. I'm getting the token using Resource Owner Password Credentials flow and: After performing SystemUpdate I got "Attempted to ...
Konrad's user avatar
  • 31
0 votes
0 answers
26 views

How to check if SharePoint URL exists?

Let's say we have the following SharePoint working URL: https://mywebsite.sharepoint.com/_layouts/15/Test.aspx The following code works for determining if the URL works or not unless the user is ...
Chuck Norris's user avatar
0 votes
0 answers
9 views

CSOM: Can access SharePoint ListItems of one list, but not the other

I have two lists (Red and blue) on the same domain, but can only fetch list items from one of the lists. I can see item count, id etc. of both lists. My app has all rights to Sharepoint This is my ...
ChrisKrejler's user avatar
0 votes
0 answers
23 views

Getting Access Denied when creating ClientContext without Credentials

I have an ASP.NET MVC Web API (on .NET 4.7.2) that is published under SharePoint IIS site. In this Web API, I am trying to create list item. It works fine when I pass credentials in the code - like ...
Raf's user avatar
  • 1,038
1 vote
1 answer
47 views

ClientContext API will not return items in Teams SharePoint site, works fine in SharePoint Online

Would there be a difference in using the 'older' SharePoint ClientContext/CSOM based API against a site in SharePoint Online versus one that is a part of a Team? I have a bit of code that works just ...
jmlumpkin's user avatar
  • 141
0 votes
0 answers
14 views

Cannot get SharePoint image

This is my first time developing with Microsoft and I'm having a lot of problems. I'm currently working on a project about PowerPoint plugins. I want to get all the images in a folder in SharePoint, ...
peng James's user avatar
0 votes
1 answer
13 views

GetSiteDesign Does not retrieve Document Sets Content Type

I am using CSOM, trying to create a template where the site already has document sets enabled. However, when I get the site script from the template site and I apply it to a different site, applying ...
Rodrigo Campos's user avatar
0 votes
1 answer
20 views

How do I get the list of Terms not used in any TaxonomyField in a CSOM Console App?

I would like to delete terms not used in a TaxonomyField on any Item in a Document Library. I am new to CSOM and can't figure out how to proceed on this. Can you help, please?
vishwa's user avatar
  • 5
0 votes
2 answers
43 views

check permissions on single folder

The following code works fine for a test site with a just a few folders, but fails on the live site which has around 8000 folders. How can I just check permissions on a single folder, like Documents/...
Jay Shobe's user avatar
-1 votes
1 answer
45 views

How to update the list item from grid(custom web part)

I have one list.in that list title column,Start date ,Due DAte ,Assigned To,Status column is there.And some entries also there.All the list items i am displaying in one grid.After that in that grid ...
BHARATHI PAULRAJ's user avatar
0 votes
0 answers
35 views

Can't upload a file to sharepoint site's file directory using CSOM C# console app

I am trying to upload a file to a specific site's file directory in my org's SharePoint. I created an app on https://OrgTenant.sharepoint.com/sites/MySite/_layouts/15/appregnew.aspx. Then, I gave it ...
Jaelen's user avatar
  • 1
0 votes
0 answers
10 views

how to use CSOM in UWP in Visual Studio to grab a list or site's full user permissions

I've tried searching for tutorials or guides but could anyone point me in the direction of using a .NET application that grabs a sharepoint online site/lists users and their permission levels? Thank ...
d delep's user avatar
0 votes
1 answer
42 views

SharePoint List, help deleting the Title field or remove from defaultview?- using CSOM

Using CSOM for SharePoint Online Site Collection, able to create lists, edit lists items, add list items, etc. Just can not figure out how to either delete the 'Title' field or just remove it from the ...
Benny H.'s user avatar
0 votes
0 answers
21 views

How to get a Video Thumbnail using PowerShell on SharePoint SE version?

I have a SharePoint (Subscription Edition) document library that is hosting some videos I uploaded. How can I get the video thumbnails using PowerShell? Again, the SharePoint version I am targeting is ...
Jean Paul Larach's user avatar
0 votes
0 answers
53 views

Error Connecting to SharePoint 2019 via CSOM

We are getting a 403 error when trying to connect to a SharePoint 2019 site via CSOM in one of our environments. The accounts being used have the correct permissions and I am able to connect to the ...
Rogerb's user avatar
  • 21
0 votes
2 answers
197 views

SP 2019 CSOM Console App

I am trying to develop a CSOM console app for a SharePoint 2019 site and I'm having trouble authenticating. I've tried: context.Credentials = new NetworkCredential("username", "password&...
Rogerb's user avatar
  • 21
0 votes
0 answers
17 views

How to get all Default sites of a SharePoint using CSOM?

I have tried to getting all the sites of the tenant but I can able to get all Site Collection as well as the Sub Site. But I can't get the Default site like CompliancePolicyCenter, ...
Dood's user avatar
  • 1
0 votes
0 answers
15 views

orphaned Site using CSOm

I'm looking to get the orphaned site using CSOM for my Application but I don't get any reference regarding to this. Is there any way to get the orphaned site using CSOM?
Dood's user avatar
  • 1
0 votes
0 answers
76 views

CamlQuery Recursive Search Under Specific Parent Folder

I am trying to recursively search all folders and files under a specified folder for given text. For example sake, lets say my file directory is as follows- /sites/UsersTeam/Shared Documents/Folder A/...
A_Frustrated_CSOM_Learner's user avatar
0 votes
0 answers
111 views

SharePoint CSOM API - Current site is not a tenant administration site

We use this code to iterate tenants site collections: string url = $"https://{initialDomainName}-admin.sharepoint.com"; var context = new ClientContext(url); context.ExecutingWebRequest += (...
Nazar's user avatar
  • 1
0 votes
0 answers
43 views

Using CSOM, How to check-out a list item?

I want to update a list item in a list with versioning enabled on it. I should check out item before update, update it , and then check it in. I find CSOM code for Check in/out a file in a document ...
Hamed's user avatar
  • 1
0 votes
0 answers
17 views

How to add a lookup when creating a new ListItem?

I've found multiple Q/As here and other resources about adding a lookup value to a new ListItem upon creation and, based on those examples, it seems like it should be straight forward. However, I ...
ChiefTwoPencils's user avatar
1 vote
0 answers
51 views

How to get the comments of a file by using CSOM?

I have an issue related to fetching the comments inside file/document by using CSOM. This is an image of a comment that I want to get from file: I used code like this but it doesn't work for me. It ...
Harry Liu's user avatar
0 votes
1 answer
69 views

Add Enterprise Keywords to a library programatically

When we go to the settings of a library, we can navigate to Enterprise Metadata and Keywords Settings In here there is a checkbox that can be activated. If activated through the UI, the checkbox stays ...
Tiago Duarte's user avatar
  • 5,477
1 vote
2 answers
39 views

Roadblocks in adding fields via CSOM in SPO

I have a program that is creating some lists and adding the necessary fields to the lists in SPO. I have marked some of these fields as Required, but in list settings they do not show up as Required. ...
entryton's user avatar
  • 332
0 votes
1 answer
65 views

How to migrate files to SharePoint using CSOM while retaining publishing history

We are planning to migrate documents from an existing Document Management System into SharePoint Server 2019. The chosen API is CSOM, since there is a chance that the target SharePoint solution will ...
Lars Kohsel's user avatar
0 votes
0 answers
21 views

Due to Multi-geo is there any changes in the CSOM data or API call?

Consider if a Tenant is enabled Multi-Geo, using CSOM will cause any changes in the returned data? Any modification is required for CSOM API?
Janakiram's user avatar
0 votes
0 answers
522 views

Update moderation status (Approval)

I want to update the Moderation Status of a Document (minor version enabled) from Pending to Approved or Rejected without affecting the Modified By column. I have tried ootb flow Action 'Set Content ...
Orange Juice Jones's user avatar
0 votes
0 answers
915 views

download a SharePoint file to a specific folder on the local computer using c# and CSOM

I try to download a online file programmatically, which is stored in a document library to a local folder. I know that I need to open a stream and then copy the stream to the local drive, but I'm a ...
Matthias's user avatar
0 votes
1 answer
1k views

Get all Folders and Files recursively in SharePoint online with CSOM in C# and store it in one list where I can work with it

my current code get all the folders from a root site. After that it uses the itemId. From that itemId it gets the subfolders and files. I don't know how I can store the Id's persistent that I can loop ...
Matthias's user avatar
0 votes
0 answers
148 views

CSOM - Field or property "QueryText" does not exist

I am attempting to search files and folders held in SharePoint for a user entered phrase but consistently get the following exception: Microsoft.SharePoint.Client.ServerException HResult=0x80131500 ...
phuzi's user avatar
  • 105
0 votes
1 answer
229 views

Random error: The request was aborted: Could not create SSL/TLS secure channel

I'm writing a C# Winform application with the help of CSOM library. I need to navigate a SharePoint site and, when I point a PDF file. I need to download it and show it. The basic routine (I found on ...
SteMMo's user avatar
  • 101
0 votes
1 answer
157 views

Create a tree view in c# on SharePoint Online Document Library Basis with CSOM

I want to create a Treeview in C#. My basic data is stored in a SharePoint Online DocumentLibrary. I authenticate with a user and I want to show the folders and files as a tree view in Azure function ...
Matthias's user avatar
0 votes
1 answer
1k views

Access SharePoint Online via CSOM with access Token from Username/Password in Azure Functions

I want to access a SharePoint site with a Token, which I get by Username and PW (AcquireTokenByUsernamePassword). I get the Token and I can access the site via Postman without any problems, but in my ...
Matthias's user avatar
0 votes
0 answers
30 views

Sharepoint C# Data Transfer Date Issue

I transfer data from one tenant list to another tenant list with c#. I'm passing the date columns into a string value. Received data; 3/1/2023 18:00 String value; 3/1/2023 18:00 Value written to the ...
Yunus Emre's user avatar
0 votes
1 answer
960 views

Get all Files and Folders and subfolders from a Root Site in a tree view with C# in a PNP Core Framework

I'm currently using PNP Core Framework with a "normal" console application. I want to get all Files and Folders from a specific Document Library. How can I do this in a simple way? I tried ...
Matthias's user avatar
1 vote
1 answer
2k views

CSOM PowerShell script - moving to modern authentication

I have a complex CSOM script that I need to get working for a Tenant that uses Modern Authentication. This works fine using Basic Authentication. Its not an automated script so an interactive login ...
user3844416's user avatar
0 votes
1 answer
817 views

CSOM vs PnP Core SDK vs Graph API, which approach is more future proof

We want to start a new project which include creating an azure function (using .net 6.0) that runs on timely basis to create folder structure as follow:- we have a SharePoint custom list which allows ...
John John's user avatar
0 votes
2 answers
2k views

Use CSOM with Secret to integrate with sharePoint Online

I found this video on YouTube which show how to use PnP core inside Azure Function to integrate with SharePoint Online @ https://www.youtube.com/watch?v=9erhWdwbkq8&t=543s but can i have the same ...
John John's user avatar
0 votes
0 answers
24 views

CSOM Search for documents

I am using search API to search keyword for documents (pdf, word) but the result returned contains only the document Title and path...etc I want to return the Paragraph which contains the search ...
booody's user avatar
  • 3
0 votes
1 answer
161 views

How to add multiple RoleDefinitions to RoleDefinitionBindingCollection?

Why I can't add multiple role definitions to a RoleDefinitionBindingCollection? Always only the last role is added. Why? Its, a collection of roles, or? $group = Get-PnPGroup -Identity "MyGroup&...
sp00ky's user avatar
  • 27
0 votes
1 answer
117 views

Right User Permissions to use ListItem.GetUserEffectivePermissions method

I'm currently using a SharePoint account as a Service account to get files and share them in an application I'm working on using CSOM. I filter the files according to the logged-in user to check if ...
Ahmad Adel's user avatar
0 votes
1 answer
281 views

replace PnP.Core.Services with CSOM for our Azure Function which uses .net 6.0

I have an Azure Function which uses PnP.Core.Services to interact with SharePoint to create a list item. The Azure function is based on .net version 6.0. I have this startup.cs:- using Microsoft.Azure....
John John's user avatar
1 vote
0 answers
123 views

CSOM Updating List Item in Large List throws Threshold Error

Background: Have a large document library (25K+ Documents) in a SharePoint Online Website. We migrated this Document Library from SharePoint 2013. This library has a few MetaData Lookup columns ...
ckas's user avatar
  • 11

1
2 3 4 5
39