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
0answers
6 views

Unable to get the “vti_filesize” for our document library items inside our sharepoint online remote event recevier

I am working on developing a remote event receiver for an online document library inside a communication site collection. and inside the ItemDeleting RER, i want to check if the item that is going to ...
1
vote
1answer
20 views

The given value for a taxonomy field was not formatted in the required <int>;#<label>|<guid> format

I have the following code to set the column default values for a library:- var corpTypetaxValue = listItem["CorpType"] as TaxonomyFieldValueCollection; var corpTypeFieldValueArray = corpTypetaxValue....
0
votes
1answer
28 views

The type 'SPFolder' is defined in an assembly that is not referenced. You must add a reference to assembly

I am working on building a remote event receiver, and i added the following nuget package Install-Package Microsoft.Office.DocumentManagement -Version 15.0.0. Then on this line of code:- ...
0
votes
0answers
17 views

Project CSOM 'User:<customercontent></customercontent> not found in Active directory or in project db.'

I am trying to access the Project Online CSOM without using an authenticated user. I want to use a process similar to below: https://bamrotiya.blogspot.com/2018/08/csom-authentication-without-...
0
votes
1answer
18 views

Unable to get Security groups inside my CSOM “Group Not Found”

I have a site column of type People/Group named "SecurityGroups" which contain security groups. now i want to get those security groups and add them to our Folder permission. tried the following code:-...
0
votes
0answers
12 views

change from sharepoint 10 to sharepoint online

We developed .Net component which runs on a windows server and writes to Sharepoint 10. We need to change it to write files to Sharepoint Online. Before we were using Microsoft.Sharepoint.Client.dll ...
0
votes
0answers
19 views

Configure the “Column default value settings” inside our remote event reicever. is this possible

Inside any document library we can set the "Column default value settings", as follow:- but i am working on a remote event receiver, where i created a root folder, as follow:- ...
1
vote
0answers
18 views

CAML query for child properties

I have a CSOM query like this one: _context.Load(currentItems, lis => lis.Include( i => i.RoleAssignments.Include( ra => ra.RoleDefinitionBindings, ...
0
votes
1answer
15 views

Unable to add Sub-Folders using CSOM

I have the following code to create a root folder and sub-folders inside my remote event receiver:- foreach (ListItem i2 in collListItem2) { var templatenumber = isDeal ? "10" ...
0
votes
1answer
20 views

CSOM. check if a folder exsists before trying to add it [duplicate]

I have the followoing code to create a folder inside a document library:- ListItemCreationInformation listItemCreationInformation2 = new ListItemCreationInformation(); // Below are options. ...
0
votes
1answer
11 views

Error “Cannot add a role assignment with empty role definition binding collection`” when i try to grant folders unique permission

I have the following code inside my remote event receiver to grant a folder unique permissions:- RoleDefinition readerDef = context.Web.RoleDefinitions.GetByType(RoleType.Reader); ...
0
votes
1answer
36 views

How i can break the item permission for a list item and assign all the Groups Read permission level

I am working on a Remote Event Receiver, and i want to do the following:- Break item permission + copy the permission. For all the SharePoint groups assigned to a list item >> grant them Read ...
1
vote
2answers
34 views

How i can update a managed metadata column with multiple values using CSOM

I have the following code inside my remote event reciever, to create a new folder, and then populate the folder managed metadata fields with the current item (item that was added) values:- ListItem ...
2
votes
1answer
32 views

I want to get list where invoice _category is service please help? [closed]

I want to get the list items where invoice _category is equal to "Service". Please help? Current code: camelQuery.Viewxml = "<View><Query> <Where><Eq><FieldRef Name='...
0
votes
0answers
19 views

Connecting web parts through Javascript in SharePoint 2013

I am working in SharePoint 2013, and I have two OOTB web parts (list view & URL filter) that I want to connect programmatically. I also want this to be a client-side solution with JavaScript, ...
2
votes
0answers
35 views

SharePoint provider hosted add in throwing 401 error on execute query

We have a provider hosted app used by many customers in SharePoint Online, but there is this one new customer who is getting this error whenever he tries to launch the app after installation. ...
1
vote
1answer
17 views

Get all onedrives from c#

I am looking for a c# snippet for getting all OneDrive's. There is a lot of sample for PowerShell, but I am looking for c# snippet that can provide all OneDrives in a tenant.
0
votes
1answer
18 views

Copy list items from multiple source lists to a single target list

I have been given a task to make a script in CSOM. I am very new to Powershell so any help would be appreciated. I have a site collection with multiple calendars within the sites. I have to create a ...
0
votes
1answer
23 views

Is it possible to Post a Message to Teams Conversation using the SharePoint ClientContext?

I was successfully able to add a File in the Files tab of Teams, using the SharePoint.Client.ClientContext But I could not find any documentation on posting a message using the clientContext. Any ...
1
vote
1answer
16 views

Reply to a topic in Discussion board List using CSOM

I am working with a Discussion board list. I need to create the whole list using CSOM from scratch. To which I was able to make the list and topic inside it as folders. But I am not able to add ...
0
votes
0answers
18 views

Configure Connections of Query String URL Filter web part programmatically

I am trying to configure the connections of the query string url filter web part with JSOM. The connections do not seem to be stored in the web part's properties, so I am at a loss as for how I can ...
0
votes
0answers
27 views

'Permission access denied or don't have access' issue in sharepoint webhook

I am new to sharepoint webhooks and was referring this official site and this pnp sample documents to get notification detail. I had successfully got notification hit in my Web application after any ...
1
vote
0answers
35 views

How to set Retention label to SharePoint Document using CSOM?

I am trying to set the retention label (i.e. Office 365 admin under Security & Compliance center) to a file in a SharePoint Online Document Library using CSOM. I can set the Retention Label using ...
2
votes
1answer
28 views

How to get “Allowed Content Types” of a DocumentSet by CSOM on SPO?

I have a SPO site with some DocumentSets having different ContentType. I need to get "Allowed Content Types" of any DocumentSet to take a decision: I get my DocumentSet as ListItem or as Folder or as ...
1
vote
0answers
25 views

How to detect user sign out in sharepoint Provider Hosted App

I want to detect when user logout from SharePoint site to SharePoint add-in. Now I'm getting current user using this code: var user = clientContext.Web.CurrentUser; clientContext.Load(user); await ...
0
votes
2answers
124 views

The sign-in name or password does not match one in the Microsoft account system

When connecting to online site we have Microsoft authentication call to our phones and we will enter our pin for authenticating.Then only we can access the site. But in csom code when conencting to ...
0
votes
1answer
42 views

SharePoint Online - CSOM API requests for getting site metadata fails when permissions are properly set

I've got an interesting permissions problem with the CSOM API. We have about 200 site collections. I have created a Permission Level on each site collection, and have assigned a Service Account AD ...
2
votes
3answers
67 views

Fastest way to create multiple list items (around 2000 items) into a list using C#/CSOM

Somebody please suggest me the fastest way to add multiple items into a SharePoint list. My current c#/csom code is taking too much time in populating the list. And I have to do this activity every ...
0
votes
2answers
37 views

Remove unique permission on list item

I have run the csom code for break inheritance and set the unique permission on list item (ex.contribute). when user modified the list item, i want to the remove that unique permission and set other ...
0
votes
1answer
21 views

AllowMultipleValues in taxonomy field in CSOM Javascript

I am trying to create a taxonomy column within JSOM , I am nearly there but I have set the type to : var fieldSchema = `<Field Type="TaxonomyFieldTypeMulti" Name="...
0
votes
1answer
29 views

Get files in same directory as Excel document via VSTO

I have a VSTO on Ms Excel/Word which checks the current location of the active document (Dim MyPath as String = Application.ActiveWorkbook.FullName), and then pulls the list of files located in the ...
0
votes
0answers
14 views

Read the user and permission from excel update in sharepoint site and group

I want to read the user name and the access from the excel sheet and update them in a list item level permission.
0
votes
1answer
21 views

Serialize and deserialize SharePoint CSOM objects

I want to serialize the objects of CSOM to JSON store them. Later nee to deserialize them. I know there is no direct way to do that it will give an error : "The property or field '----------' has ...
1
vote
1answer
36 views

CSOM C# Copy Library from one Site Collection to another with all folders / subfolders intact

Any help would be appreciated here. Below is my attempt to copy files and folders from one site collection to a completely different site collection. The structure from one side to the other should ...
0
votes
2answers
43 views

CollectionNotInitializedException

I slightly modified this example of how to use CSOM to display a list's current views. I'm getting the following error: "Microsoft.SharePoint.Client.CollectionNotInitializedException: 'The collection ...
0
votes
1answer
30 views

How to add non list based OOTB web parts with JSOM Sharepoint 2013

I am attempting to add a Query String Filter Url Web Part to a page programmatically with JSOM and am hitting a dead end. I see how you can add a web part if you already have the XML like in this ...
0
votes
1answer
23 views

How I can update Location Field in SharePoint Online using CSOM C#?

I need to update the value of newly introduced column "Location" field in SharePoint Online Via CSOM C#. is it possible to do so? I tried using FieldLocation and FieldGeoLocation classes but unable ...
0
votes
1answer
27 views

If a document already exists in a document library with same , upload with different name

I need to upload a document like 101-EDU.pdf, If a file with the same name already exists in the document library, then the file should be uploaded with name 101-EDU-1.pdf ...
0
votes
3answers
39 views

Unable to get the custom list item versions using (ListItem.Versions) inside my CSOM

I have the following code inside my console application:- CamlQuery camlQuery2 = new CamlQuery(); camlQuery.ViewXml = "<View><Query><Where><Neq><FieldRef Name='ProjectStage'...
0
votes
1answer
21 views

Checkout using CSOM does not prevent update/rename/deletion

I'm trying to prevent any data change for a file using CSOM, but even after checking out the file, the UI still allows update/deletion/rename. Is there a way to prevent this, i e to lock/checkout the ...
0
votes
1answer
46 views

CSOM CAML Query - is there a returned fields limit?

I've just noticed that that there is a difference in result when searching for a list item with CAML Query and getting it by ID. Following piece of code returns item with 100 FieldValues: var item = ...
0
votes
1answer
22 views

Programatically define document set default view

Im trying to be define a document set default view from powershell, code, csom, or site template, but I cant find any way to do so. My library have 5 views, and I have a document set XX added to the ...
0
votes
2answers
30 views

Using CSOM, how can I delete anonymous links for files?

foreach (ListItem item in items) { var sharingInfo = ObjectSharingInformation.GetObjectSharingInformation(cxt, item, true, true, true, true, false, false, false); ctx.Load(sharingInfo, si =>...
0
votes
0answers
18 views

Read Write file using csom

I was wondering, if there is any suggestion to read write the files from local machine using CSOM. Scenario : i have one .xml file and one .txt file, now i need to copy content from .txt and paste ...
0
votes
0answers
19 views

Using CSOM, can site sharing settings be accessed, specifically the setting that restricts site sharing to only site owner?

Using CSOM, is there a way to check a site (Web) to ensure that only site owners can share the site? In the SharePoint modern UI, the site sharing option reads "Site owners and members, and people ...
1
vote
1answer
52 views

Error retrieving items from large list, although the CAML query has a row limit

I'm able to use a console application to connect to a SharePoint Online large list (more than 5,000 items) and retrieve the title. However, even though my CAML query has a row limit, I still get an ...
0
votes
1answer
68 views

Export sharepoint list item into excel using csom

I have a custom list. I have filtered with single item, based on ID. Now, I want to export that particular list item into Excel by CSOM coding. Please note, I don't want to export in CSV file format....
0
votes
1answer
26 views

Assign Managed Metadata column values from source page to another publishing page using CSOM

I am writing a CSOM to get the values of a managed metadata column (sourceWikiPage) and assign it to another page (newpage), here is my code:- File sourceWikiPage = context.Site.RootWeb....
0
votes
2answers
57 views

Unable to get the PageLayout for a PublishingWeb using CSOM. Error “The object is not associated with an object identity”

I am working on a console application which uses CSOM to integrate with SharePoint online. and i want to create a publishing page, so i wrote this code, to get the PageLayout and create a new ...
0
votes
2answers
155 views

Does CAML query support Does Not Contain

I am working on a console application to integrate with SharePoint Online site collection. and I want a way to get all items that do not contain the word "fail" and do not contain the word "success", ...

1 2 3 4 5 34