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
1answer
20 views

How to get folder by url (“Copy link” button)

I have link to SharePoint online folder like: https://domain/:x:/s/Site1/EcEHhjfer8tBhw84D4iadQUBdCcX_MGw-EpH_lQwXUPJjw?e=pBgWZS How can I get the folder using CSOM? I need to be able to read the list ...
0
votes
1answer
19 views

How to add records to a SharePoint list using Rest API / JSON and HTML

I have been doing a lot of research and reading and I am still having trouble understanding how to accomplish my goal. For reference I have been here reading: Get to know the SharePoint REST service I ...
0
votes
1answer
23 views

In C# with CSOM, How can I copy a file from a known location to a known Folder?

I have one function which uses SearchExecutor finds to find the path of a specified file, which returns a string like. https://example.sharepoint.com/sites/DevelopementTestingSite/Shared Documents/...
0
votes
1answer
50 views

Is there a property that indicates a ListItem has been shared?

I need to extract sharing information for list items, I'm currently doing this with ObjectSharingInformation.GetObjectSharingInformation using the securableObject overload and passing the list item. ...
0
votes
1answer
35 views

SharePoint 5000 List View Threshold Limit Issue in CSOM

I have an issue with Sharepoint CSOM when I am trying to get subfolder with the following code public void LoadFolders(Folder folder, SharePointFolder sharePointFolder) { Context.Load(folder.Folders)...
1
vote
2answers
31 views

Add AD Groups to Sharepoint Online Group using CSOM

I have the following situation: AD: Users Groups Sharepoint: Groups The hole point is to add both the users and the groups from AD to Sharepoint. I got adding the users to work using the following ...
0
votes
1answer
28 views

How to create modern page in SharePoint online using CSOM Powershell

I want to create modern page in a modern site using CSOM PowerShell instead of PNP. After creating that I need to configure list and Events we part in that. Please guide me on this. Thanks in advance!
0
votes
1answer
26 views

How to disable SharePoint 2013 alerts using CSOM

Using CSOM, I am able to retrieve the collection of alerts for a SharePoint Online site and disable each alert using the following code: context.Load(context.Web.Alerts, collection => ...
0
votes
1answer
15 views

Why don't SharePoint's list apis encode serverRelativeUrls?

When calling SharePoint list api's whether it be CSOM, Rest and Soap apis, they all refer to server relative urls without escaping for URLs. When you are using the apis, inevitably you want the ...
0
votes
0answers
7 views

PWA - ProjectContext - 401 Unauthorized Error

We just wanted to provide all tasks to qlikview but there is a small problem with authentication. We are using CSOM to fetch all tasks from PWA. It fetches all tasks properly when debugging but when ...
0
votes
1answer
24 views

RegionalSettings.TimeZone.UTCToLocalTime will always return 01/01/0001 00:00:00

I have the following CSOM code inside my C# console application:- var regionalSettings = context.Web.RegionalSettings; var localDueDate = regionalSettings.TimeZone.UTCToLocalTime(itemversion.Created)....
0
votes
1answer
20 views

Upload an app to app catalog from a sharepoint location

I have a provisioning script which is run as a web job where i need to create a site collection app catalog and then add an app to it. I am storing information about the site in a sharepoint library ...
0
votes
1answer
28 views

Inside my CSOM code how to convert UTC date time into date time as per the regional settings for the site collection

I have the following code to get the Created date time for a list item:- ((DateTime)item.Created).ToString("dd MMMM yyyy HH:mm:ss") + " )" now the date time i will get will be in ...
0
votes
1answer
43 views

Correct way of Convert Enhanced Rich Text field to Plain Text (multiline) - Sharepoint 2013

I changed a type of a Enhanced Rich Text column to Plain Text field. I am seeing similar to the following content in the text field now. <div class="...
0
votes
0answers
21 views

SPO security trimmed search results in a web application

Wondering if you can help, I have scoured the internet and can't find anyone with the same issue. Looking for a way for a user to login to the web application (completely internal) using their O365 ...
0
votes
0answers
22 views

Azure Function Updating user profile using SharePoint Online and CSOM .NET Standard gives access denied

I have Azure Function v3 and I want to update Sharepoint user profile properties with CSOM and .NET standard 2.0 by using global admin account credentials. Reading is working. I can change other users'...
0
votes
1answer
22 views

How to get Sharepoint user group ,permission level, created , Created by ,Modified, Modified by using CSOM

I need to get the User group details. GroupName, Permissions levels, Created by Created date, Modified by , Modified Date. I am able to get the Group Name and Permission Levels. How to get the Created ...
0
votes
0answers
20 views

Cannot upload file via CSOM to SharePoint 365

We have CSOM code to upload a file to sharepoint and it always worked great but we've just encountered a problem that we cannot resolve. For some reason, we keep getting a "access denied" as ...
0
votes
1answer
26 views

Do i need to Issue ListItem.Update(), when i am executing these commands ( ListItem.ResetRoleInheritance() + ListItem.RoleAssignments.Add() )

I am working on a remote event receiver inside SharePoint online custom list. now inside the RER i am getting the item been updated, then reset its role inheritance + add users to the item permission, ...
0
votes
1answer
62 views

Modern Authentication, do we need to change something in C# CSOM?

I heard that MS will use only "modern authentication" later. We have some apps on our servers that connect to SharePoint Online and use CSOM. Will this code-snippet continue to work, or we ...
0
votes
0answers
23 views

Upload large file from SharePoint to external API

I am developing an API project using MVC .NET to copy a SharePoint file to external system (which is not SharePoint). I am getting the stream of the file in SharePoint using below code: ResourcePath ...
0
votes
0answers
13 views

Unable to verify file existence using CSOM PowerShell having file name with Unicode character in SharePoint Online

I have a requirement to check if files in my local folder exists over one SP Online Library. I have written CSOM Powershell to verify the same and it is working fine. But where the File's name is ...
0
votes
1answer
22 views

I am able to access a property even if i am not loading it inside my CSOM code

I have the following code, to get a list item based on the ID and load specific properties only, as follow:- CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = string....
0
votes
2answers
29 views

Getting (400) Bad Request error while moving files from one folder to another folder in same document library using CSOM

I have a console application in which I am trying to move files from one folder to another folder in same document library using CSOM. While doing so I am getting below error: (400) Bad Request I ...
0
votes
1answer
51 views

Create a new lit item will riase this error “Operation is not valid due to the current state of the object”

I have the following code to copy a list item to another list:- List oList = context.Web.Lists.GetByTitle("Supplier Contracts"); List oList2 = context.Web.Lists....
0
votes
1answer
22 views

The property or field 'Exists' has not been initialized. It has not been requested or the request has not been executed

I have the following CSOM code to check if a folder exists:- private static void NewTryToAttachFiles(ClientContext ctx, Web web, List fromList, ListItem fromItem, List toList, ListItem toItem) { ...
0
votes
1answer
24 views

ItemAdded remote event receiver will fire twice if i create a new list item + attach file to it

I have a custom list inside a SharePoint online communication site. and i have attached an ItemAdded remote event receiver to the custom list. now if i create a new list item and i do not attach any ...
0
votes
0answers
23 views

SharePoint's Search API or CSCOM search didn't return OneDrive site for some of demo tenants

I am using CSCOM to search all site collections for tenant using: https://demotenant1-admin.sharepoint.com/_vti_bin/client.svc/ProcessQuery with following parameter: <SetProperty Id="8" ...
0
votes
1answer
17 views

Is it possible to use ExecuteQuery without Load?

I have the following little routine that uploads a document to SharePoint 2019 on premises and works fine. But I don't understand why it works without a clientContext.Load(uploadFile) statement. How ...
0
votes
0answers
6 views

Import SQL data to sharepoint list using Csom

I have SQL Table and it has 20 columns Data and i should copy all the SQL table data to SharePoint list as SLT,LOOK UP,CHOICE AND Date format using CSOM
0
votes
1answer
49 views

'AuthenticationManager' does not contain a constructor that takes 0 arguments

I have the following code to connect to SharePoint using clientID and ClientSecret: string siteUrl = "https://****l.sharepoint.com/sites/DocumentApprovalProcess/"; string clientId = "***...
0
votes
2answers
56 views

SharePointOnlineCredentials is raising this error “The sign-in name or password does not match one in the Microsoft account system.”

I have the following code to connect to a site collection:- string s = "******8"; SecureString passWord = new SecureString(); foreach (var cc in s) ...
0
votes
2answers
31 views

get audit log value CSOM

I have problem how to create API get Audit log and get return value via CSOM? when i try to this Site collection audit settings for Sp online using CSOM this is i can't get value it's only save to ...
0
votes
1answer
41 views

Getting to count of documents where modified older than 30 days

Is there anyway to get the count of documents where document has not been modified for 30 days? I was thinking of CAML query but is it possible to only get the count? Some list contains hundred of ...
1
vote
1answer
28 views

ReadOnlyField Vs ReadOnlyEnforced when creating Site Columns

When creating a new site column inside Sharepoint Online, we have 2 options to set: ReadOnlyField and ReadOnlyEnforced. So, what are the differences between these 2 settings? As far as, I know ...
0
votes
1answer
81 views

SharePoint CSOM with .net standard | Credentials vs App

I am trying to understand how the authentication works using a .NET core application to O365. The article here describes it: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-...
0
votes
1answer
47 views

CSOM code is raising this error “Version conflict.” when trying to update ListItems inside foreach

I have the following CSOM code:- using (ClientContext context2 = Helpers.GetAppOnlyContext(properties.ItemEventProperties.WebUrl)) { try { ...
0
votes
1answer
45 views

I am able to update a ReadOnly field inside my CSOM code

I have set a field as read-only using this PnP script, the field is of type "image or hyperlink":- $fieldTitle = "LinkToRiskValue" $customfield = $Context.Site.RootWeb.Fields....
0
votes
1answer
83 views

copy or move replace file and update version sharepoint CSOM

hi im using method for copy or move file on sharepoint. but i want to ask how to implement when it's duplicated it automatically replace and update version? i've been try with this function but it's ...
0
votes
0answers
14 views

Getting users and groups from root of permissions with CSOM

We can easily get all the SharePoint groups and iterate users and groups within those. var groups = SPOContext.Web.SiteGroups; SPOContext.Load(groups); SPOContext.ExecuteQueryWithIncrementalRetry(3, ...
0
votes
1answer
68 views

Error Method “OpenBinaryStream” does not exist SharePoint file download using CSOM C#

we are using the below code to download a file from the SharePoint 2010 on-premise and from SharePoint online site. The code is working fine SharePoint online file and getting the error Method "...
0
votes
2answers
68 views

Unable to get the list default edit form URL using CSOM Powershell

I am using the CSOM for PowerShell to get all the default forms(new/display/edit) used by the list in SharePoint online site. Below is the code snippet for the same. $NewFormUrl = $List....
0
votes
1answer
76 views

How can I export a sharepoint online list with version history enabled to excel?

I have enabled version history on my custom list. Now when i do an export to excel all the multiple text fields don't show any data at all. How can i get it to export all the fields with data and the ...
0
votes
1answer
24 views

Is it possible to add different person-value items to SharePoint list using CSOM? C#

I don't think it is possible, but hoping I am wrong. I'm using a CSOM in a C# application to update a SharePoint list (SharePoint Foundation server). All of the items on the list are updated correctly,...
0
votes
2answers
19 views

Unable to update a field internal name. Erro “Property or indexer 'Field.InternalName' cannot be assigned to — it is read only”

I have the following CSOM code to update a field internal name:- using (ClientContext context = new ClientContext("https://*****.sharepoint.com/sites/Intranet/")) { ...
0
votes
1answer
37 views

'ListItem' does not contain a definition for 'SystemUpdate' and no accessible extension method 'SystemUpdate'

I have the following CSOM code inside a console application:- ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation(); ListItem listItem2 = riskValue.AddItem(itemCreateInfo); ...
0
votes
0answers
22 views

How to download the root-folder SharePoint aspx file including web-parts using PowerShell csom?

I want to download the SharePoint 2013 root folder aspx files to local path and then copied to SharePoint 2016 sitepages library. Tried below code but it downloading empty aspx file without webparts....
0
votes
0answers
24 views

Create a SharePoint sharelink with expiration and password using C# CSOM API

From the SharePoint UI, you can share a document by providing an expiration date for the link and also securing that link using set password. Can the same be achieved from C# code using CSOM libraries?...
0
votes
1answer
13 views

Cannot set properties of default fields on SP.Folder item with JS

I'm working on code to create and set properties of folders in SP 2013 with JSOM. My current setup involves the following: var ctx = new SP.ClientContext.get_current(); var list = ctx.get_web()....
0
votes
1answer
28 views

Getting thumbnail data for documents with CSOM / API

In our project we're trying to integrate with SharePoint Online using SharePoint App-Only authentication method and client-side object model (CSOM) to retrieve data. This solution seems to be working ...

1
2 3 4 5
37