Questions tagged [client-object-model]

API for interacting with SharePoint from .NET, Silverlight, and JavaScript.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

Is there a client (JS) API for interacting with PWA permissions? Namely, PWA Groups and Categories

We're starting to play around with Project Server (on-prem) using Project Server permission mode (as opposed to SharePoint permission mode). We need to be able to segregate the .mpp files so that ...
Dylan Cristy's user avatar
  • 12.7k
1 vote
1 answer
94 views

Getting list of all users that are currently co-editing document

I have some enquires on getting all the users that currently co-editing the document, I am aware of a column in documents page called "Modified By", which I can get it by using SPList. ...
whl's user avatar
  • 13
0 votes
2 answers
518 views

How to call Azure Functions App from SharePoint Online as the signed-in User (via Client-side JavaScript)?

I have an Azure Functions App (with HTTP API endpoint) which, upon triggered, needs to know the EMAIL ADDRESS of the caller; calling via the client-side (SPFx) JavaScript on the SharePoint Online Site....
夏期劇場's user avatar
0 votes
1 answer
498 views

Issues with SharePoint Online OAuth 2.0 & Lack of proper documentation

My end goal is getting an access token with which I can communicate to a SharePoint site and manage lists via CSOM (mostly upload documents into lists). I also need a refresh token to manage ...
Jurgen Cuschieri's user avatar
0 votes
1 answer
338 views

Error uploading file to SharePoint using .NET Framework 4.5

I have a problem uploading files to SharePoint from a .NET console application. I get the error "Cannot write data to transport connection: An existing connection has been forced to break by the ...
Julio Tobar's user avatar
0 votes
1 answer
92 views

Is it possible to run CSOM code to cancel workflows? (SP 2013 )

I have the following code from previous job and it worked perfectly b/c I was the SP admin and had SP Server access. Now I dont have SP server access. $web = Get-SPWeb "https://inside.nov.com&...
Stacey Born's user avatar
2 votes
0 answers
205 views

How to use Web.EnsureUserByObjectId method in SharePoint Online CSOM

I wasn't able to find anything about this method. Does anybody know how it works? public User EnsureUserByObjectId(Guid objectId, Guid tenantId, PrincipalType principalType); As I can understand from ...
Aleksei Gus's user avatar
0 votes
1 answer
148 views

How to disable search in site using sharepoint client object model

I need to disable search in site level using client Object Model. and search textbox in the top navigation. Need help on this. Thank you,
user3771062's user avatar
0 votes
2 answers
557 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 ...
Jay Desai's user avatar
  • 101
2 votes
0 answers
87 views

SharePoint Add-in: Client Id and secret for US Gov tenancy

We have a SharePoint (SP) provider hosted add-in that works in normal SP sites in commercial cloud. However, for tenancies where Azure AD is in US Gov cloud, we are not able to create the client ...
Prakash's user avatar
  • 666
0 votes
1 answer
375 views

C# client object model to connect to SharePoint online

I am trying to connect to SharePoint online site using SharePointOnlinecredentials. I am just passing the user ID and the password( secure string form) and just retrieveing the web.Title. the code ...
user38433's user avatar
  • 389
2 votes
2 answers
2k views

SharePoint Online OAuth with Azure AD Users

I used this SharePoint OAuth Article from Microsoft to get the authorization code grant flow working with a SharePoint site. The idea is to get the access token dynamically from an external app (and ...
Jurgen Cuschieri's user avatar
0 votes
1 answer
160 views

Query to filter RelatedItemID column using CAML

I have to filter RelatedItemID column from workflow task list using CAML query to get only those records that match the MAIN itemID from its corresponding main list. How do I achieve this? I tried the ...
anymo's user avatar
  • 1
0 votes
1 answer
1k views

ExecuteQuery() Vs Load() Vs Update()

I have the following code to retrieve a list item and then to update it. camlQuery.ViewXml = string.Format("<View Scope=\"RecursiveAll\"><Query><Where><Eq><FieldRef Name='...
John John's user avatar
0 votes
1 answer
119 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 ...
Murtuza Husain's user avatar
2 votes
1 answer
5k 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 ...
Brad Fortner's user avatar
1 vote
2 answers
604 views

Approve/reject workflow with comments client-side

I have a list which has a "SharePoint 2010 Approval workflow" associated to it and would like to provide the use with simple buttons to approve/reject the workflow after it was started. I managed to ...
user1371019's user avatar
0 votes
1 answer
199 views

Unable to send email inside my CSOM console application inside our office 365 sharepoint online

I have the following code as part of a console application:- using (ClientContext context = new ClientContext(scurl)) { string s = "***the password***"; ...
John John's user avatar
0 votes
1 answer
2k views

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

I have the following code inside our server-side event receiver, the code should connect to a sharepoint online list and get the total number of items, here is the code:- try { currentItem[...
John John's user avatar
0 votes
2 answers
213 views

Displaying list items via SP.ClientContext

I am currently using SP.ClientContext via JavaScript to display items from a SharePoint list. I am able to display the items via an alert or via input button onClick to display the data. However, I ...
adams-j's user avatar
  • 307
0 votes
0 answers
52 views

Accessing SP List using Rest-APi

var url = serverRelativeUrl + "MyServer/_api/web/lists/GetByTitle('Test')/items"; var httpRequest = $http({ method: 'GET', url: url, crossDomain: true, ...
SPBeginer's user avatar
  • 2,547
1 vote
1 answer
787 views

Retrieve File Sharing links via CSOM for the users outside of the domain

I currently have a program that will upload selected files to a specific folder on SharePoint and give access to specific users based on their emails using the SharePoint CSOM API, however, I am ...
Brade's user avatar
  • 121
1 vote
1 answer
120 views

Access Root Site List from Sub site using Remote Event Receiver in SharePoint Online

I am trying to access the Root site list using the sub site client context. But when I try to execute the clientcontext it gives Access Denied error. I tried to create new clientcontext by passing ...
Dhruvil Prajapati's user avatar
5 votes
2 answers
13k views

Execute CSOM code from .net core

Is there any option to execute CSOM code from .net core application? I have a bot solution from this i need to store all the conversation details in SharePoint list. When executing the code, i am ...
Sriram Tamilarasan's user avatar
0 votes
1 answer
73 views

Update a list item using Client side object module code and prevent sharepoint list workflow 2013 from been executed

I have a custom list inside our sharepoint online classic team site collection. and i define a workflow 2013 on the custom list. where the workflow will be executed when creating and editing the list ...
John John's user avatar
0 votes
1 answer
843 views

How to insert list items using JavaScript Object Model in SP

I am trying to insert list item's value through JavaScript object model in SP. When I call set_item('fieldname','Title'), it throw error "c.set_item is not a function". How to successfully Insert a ...
Mavani's user avatar
  • 477
1 vote
1 answer
2k views

Create GUID for each item created or added to a list.Using JSOM

Trying to create a unique ID(not sequential which is preferably an alpha numeric unique ID) for each row item added. The same I have tried using an EXCEL formula, but how to integrate it with ...
Bibhudutta Bhanja's user avatar
1 vote
1 answer
133 views

Sharepoint client object model "File not found" Powershell

I have some issue when i try to create a folder, but the same issue come out when i try create file too. this is a sample of my code : $web_sp = $session_sp.Web $session_sp.Load($web_sp) $session_sp....
Devtesteur's user avatar
0 votes
0 answers
325 views

unable to connect with SharePoint site using CSOM

I am trying to connect to SharePoint 2013 site with CSOM using a function with 2 arguments. When i am giving only $x that is site URL as argument then code is working fine but when i am giving two ...
Adarsh Awasthi's user avatar
1 vote
0 answers
302 views

Provider hosted app: TokenHelper not authorized to get context

I followed this tutorial to deploy Provider Hosted App to production environment. It has a proper SSL certificate installed, it's registered within SharePoint and TokenHelper class is modified. App ...
Jarek Danielak's user avatar
1 vote
1 answer
200 views

Logging client side error(JS file added in a visual webpart) to server side - sharepoint 2016

I have a visual webpart, where there is a JS file added to it. Now i need to log the errors which occur in the JS to my local drive. What we need to know is how to push the error message from client ...
Sukumar MS's user avatar
0 votes
1 answer
192 views

Cannot access SharePoint online _layouts pages using powershell

Would appreciate some help here. Using the following powershell code I can access all Sharepoint online web pages but for any page containing _layouts I get: Exception calling "DownloadString" ...
user2776646's user avatar
1 vote
1 answer
2k views

Object doesn't support property or method 'readAsBinaryString' IE 11

I am using xlsx.core.min.js to upload excel files to SP and pass their contents to a new list. I have it working in Edge but it will not work in IE 11. The first console error I received was "Object ...
seaandtea's user avatar
1 vote
2 answers
2k views

To connect to SharePoint Online Client Context using browser credentials from powershell

I am using below code to connect to SPO from powershell, but we have multi factor authentication in SharePoint. So I want to give credentials from browser instead of script. Please suggest as i ...
Adarsh Awasthi's user avatar
1 vote
1 answer
786 views

How to get client assemblies within a Non SharePoint Machine?

I am running CSOM code in PowerShell to access data of SharePoint 2013 sites. I am adding below lines to load the DLLs in my machine. These lines expect these DLLs to be present in this location. Add-...
Adarsh Awasthi's user avatar
1 vote
0 answers
97 views

Installing a Remote Event Receiver Add-in - System.IdentityModel.Tokens.SecurityTokenException

I'm working with a Remote Event Receiver Add-in in SharePoint Online and when I try to install the Add-in the breakpoint at the HandleAppInstalled(); fires, but when it tries to use ClientContext to ...
Dogemaster's user avatar
0 votes
1 answer
1k views

Floating button to submit new list item

I am trying to find information on creating a button that I can have "float" at the bottom right or left of a SharePoint page that when clicked will open a dialog box for a new list item to ...
Braden's user avatar
  • 147
0 votes
1 answer
174 views

TaxonomyInternalService.GetSuggestions Microsoft.Sharepoint.Client equivalent

With the TaxonomyInternalService.json/GetSuggestions endpoint, I can retrieve all terms with synonyms that start with some specified text. I am attempting to do this with Microsoft.SharePoint.Client....
Jeremy J's user avatar
1 vote
0 answers
48 views

Save document template from AppWeb to HostWeb document library

I am trying to create SharePoint app. Basic idea is to create document in hostweb document library from AppWeb (document template stored in AppWeb doc lib). In Details : I have created ribbon ...
Sachin Shinde's user avatar
0 votes
1 answer
594 views

Is there is any way to create popup form on button click in SharePoint Add-In

I am trying to create popup form on button click when i click on "create document" button then popup will be open and on that popup form i need one text box and button. please let me know how can i ...
Sachin Shinde's user avatar
0 votes
1 answer
31 views

problem with deleting and creating same look up field in a picture library

in my project, there is a picture library with a look field. I delete and create this lookup field like that : function MajBibliPhotoGare() { var clientContext =SP.ClientContext.get_current(); ...
Pierre Petit's user avatar
1 vote
2 answers
2k views

Can I get site Usage in Sharepoint online using CSOM?

I want to get the "Site Usage Report" on a Sharepoint Online site using C#. How can I do it? This link provides solutions to get these details but I want to do it programatically using C# (CSOM). ...
Talha Imtiaz's user avatar
0 votes
3 answers
804 views

Call a executeQueryAsync function inside success of a function

I am able to fetch single SharePoint List using JavaScript. But here I need to Query other list based on the value fetched from first list. I have also used angularjs for the page. Find the below ...
RBK's user avatar
  • 3
1 vote
2 answers
2k views

How to use CSOM TermSet.GetTerms method? Receiving strange null error

I have a piece of code in which I want to check if a specific Term is available within a TermSet. The TermSet is quite large, so getting all Terms is no option here. My code looks like this: Getting ...
vonis22's user avatar
  • 35
1 vote
1 answer
264 views

How to bind SP.PermissionKind Enumeration to a dropdown list using jquery

I need help as I have a requirement to get all permissions (PermissionKind Enumeration)and bind it to a drop-down. Also, I need help to know what are the different ways to bind Enumerator value using ...
Bibhudutta Bhanja's user avatar
1 vote
1 answer
43 views

SharePoint Client Object Model - Javascript or .Net?

We currently have a SharePoint 2010 environment and planning to migrate to SP 2016(Q2 2019). For SP 2010 we have developed a component to developers that want to consume SharePoint infrastructure. ...
ranbo's user avatar
  • 949
0 votes
2 answers
2k views

get items from a image library and bind using foreach loop with multiple HTML image ID using JSOM

I am trying to create an image slider using JQuery where I am facing difficulty to bind multiple images to HTML labels. As I have already used in while loop how to use this using for each loop to ...
Bibhudutta Bhanja's user avatar
0 votes
1 answer
2k views

PropertyOrFieldNotInitializedException on SharePoint Online CSOM

I am trying to write a simple Console Application in .NET using the CSOM object model. I write the following code (omitted the client context declaration and the authentication parts from below): ...
Gurdip Sira's user avatar
0 votes
1 answer
62 views

Copy/Delete Sharpeoint Library items to another Sharpeoint Library between date using CSOM

I hope you can help with this topic, please explain the scenario. I have a site in Sharepoint online. -I have an origin (Sharepoint library) that contains photos. My doubt is how to copy the items (...
Xoxiedrix's user avatar
2 votes
0 answers
19 views

Save file in same document set it is opened from

I have a request from a customer I am struggling with. Given is the following scenario: SharePoint Server 2016 Whenever a new document set is created a specific Excel file is added to the document ...
Feede's user avatar
  • 21

1
2 3 4 5
37