The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
6
votes
3answers
4k views

How to create List and libraries with CustomSchemaXml property using SchemaXml with CSOM in SharePoint online2010?

How to create List and libraries with CustomSchemaXml property using SchemaXml with CSOM in sharePoint online2010???? I am using following Code... // Create new list for restore List Item from List ...
4
votes
2answers
1k views

Proper way to check if Web.Title is available (CSOM)?

We can check if Web.Title is available this way: if (!_clientContext.Web.IsPropertyAvailable("Title")) { _clientContext.Load(_clientContext.Web, w => w.Title); _clientContext.ExecuteQuery() } ...
2
votes
5answers
298 views

SP 2010: JSOM function not working on page load

I am running a function on page load to update list item. Here's my complete code - jQuery(document).ready(function(){ updatePageViewCount(); }); function updatePageViewCount() { var ...
0
votes
1answer
52 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 (...
7
votes
1answer
5k views

Retrieve Multi-line Text Field with Append Changes in CSOM (Javascript)

I have been looking for an answer to this question all morning and i cannot find anything to point me in the right direction. We have several customizations to a SharePoint page which displays list ...
1
vote
2answers
61 views

Update list column data via HTML form web part

I'm trying to update list data on Sharepoint via HTML web part. This is my update function: function UpdateListItems( ids ) { var response = getNode( '<?xml version="1.0" encoding=...
2
votes
0answers
16 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 ...
5
votes
1answer
2k views

Extract text from document in a SharePoint 2013 library

I would like to extract the text from documents stored in a SharePoint 2013 online Document Library. I have the document loaded using: ClientResult<Stream> data = file.OpenBinaryStream(); ...
1
vote
1answer
2k views

Office 365 pre-provision my site issue with Powershell

I am creating personal sites using powershell csom. My issue is on below line $loader = [Microsoft.SharePoint.Client.UserProfiles.ProfileLoader]::GetProfileLoader($ctx) I get following error. $...
0
votes
2answers
253 views

Can't read Start or End Times with Client Object Model from Calendar in SP 2013

I have some experience using the SharePoint Client Object Model to retrieve text fields and URLs/images from lists in SP 2013. I'm currently trying to do something similar with a calendar. I have been ...
1
vote
1answer
4k views

Download Root level folders,sub folders and all files using CSOM C#

I have to Download Root level folders, sub folders and all files using CSOM and C#. I have to save the same folder structure and all file paths into the local system. Please provide the solution for ...
0
votes
1answer
609 views

Property bag - Index using CSOM

How can we check if the property bag is indexed and searchable? And also how is the index value for 'vti_indexedpropertykeys' encoded? I am trying to update the property bag's index using CSOM C# ...
0
votes
1answer
53 views

When adding item to List, I get error Invalid data has been used to update the list item. The field you are trying to update may be read only

I'm using Client Object Model to update a list on SharePoint. The list is very simple, it only has 3 columns ([Title], [Author], [Year Published]) [Title] is the standard column added by default, [...
3
votes
1answer
3k views

How to properly cache, validate, refresh Access Tokens?

I'm a complete newbie to SharePoint Provider-Hosted Solutions and their authentication logic. My App is an ASP MVC Solution. I run many AJAX-Calls from Client-Scripts to my Controller to interact with ...
4
votes
3answers
4k views

How to get the ID of the list item just inserted using SP.UI.ModalDialog.showModalDialog

If I am using JavaScript Client Object Model and SP.UI.ModalDialog.showModalDialog to display a form to enter a new list item, how can I get the ID of that item after its been added? Example ...
10
votes
3answers
21k views

Get a value included from a lookup column using the JavaScript Client Object Model

Related: How to retrieve a ListItem using the Javascript Client Object Model? In my previous question I was able to successfully retrieve a basic value from a list item. My problem is that I am now ...
3
votes
2answers
15k views

How to retrieve a ListItem using the Javascript Client Object Model?

Right now I am using this method: function getWebProperties(id) { var ctx = new SP.ClientContext.get_current(); this.website = ctx.get_web(); this.listCollection = website.get_lists(); ...
5
votes
4answers
16k views

Load all fields for a specific ListItem using CSOM

I want to load all FieldValues for a specific ListItem ForExample public ListItem GetItemById(List SPList, int id, string[] fieldNames) { using (Ctx) { ...
0
votes
1answer
135 views

Thumbnail of share point files

I want to display the thumbnail of SharePoint image or pdf file. In Google Drive case from Thumbnaillink we are getting thumbnail URL. Like that is there any property or api is available in SharePoint?...
0
votes
1answer
93 views

Retrieve email from People or Group Field

I have People or Group Field Normally I retrieve value of fields as: var fieldUsuario = ctx.CurrentItem.Notificar_x0020_a But now I dont want text value, I debbug it and it have email in span as: &...
5
votes
7answers
43k views

Get a SharePoint ListItem ID from a List where the 'Title' field is a specific value in JavaScript

I am trying to extract the ListItem ID of a List which I am currently NOT in based on a field value in that List. I cant find anything that explains how to do this. So, to explain. I have a Custom ...
3
votes
2answers
2k views

How can I set empty value to TaxonomyField of Microsoft.SharePoint.Client.Taxonomy?

I has a ListItem with TaxonomyField which has some value in it (some term of course). This TaxonomyField is single value only. So now I want to set it to empty, just as it was from the beginning, but ...
6
votes
2answers
4k views

Rest Query Managed Metadata Filter

I am currently writing a JSON query for office 365 (sharepoint 2013) where the filter is suppose to filter depending on values returned from a managed metadata field I am trying to filter based on ...
1
vote
2answers
7k views

Get/retreive managed metadata column value from Document Library using SharePoint 2013 JSOM

I am trying to retrieve managed metadata column (NewsCategory) value in SharePoint 2013 Document library using JSOM. I get "Object Object" rather than actual value. I tried:- var newsCat = item....
1
vote
2answers
450 views

Error of can not invoke method or retrieve property from a null object

I am using C# Winforms and CSOM - am attempting to return the version history with this method. I have verified that all variables being passed in hold an appropriate and correct value. But once the ...
23
votes
2answers
19k views

SharePoint 2013 CSOM: Is it better to pass a Context object around or a Url?

In SharePoint 2013 CSOM is it better to pass a Context object around, or a Url to open a context? Which would be the best example: (Please consider there may be a lot of methods preforming tasks) 1)...
0
votes
1answer
2k views

Programmatically set navigation settings in SharePoint 2013

When Going to Site settings>Navigation for a subsite i want to modify The Structural Navigation:Sorting to be the first value (Sort automatically) I am trying to do this with my code: ClientContext ...
2
votes
1answer
7k views

Large list issue with CSOM

Let's say there is a list with very large number of records. Now applying a particular filter on a list also retrieves very large number of items, more than threshold value. Retrieving list item is ...
1
vote
4answers
2k views

Is there a reliable way to get a Date Time with the proper timezone into a list?

I have current project where they want a time related deadline inserted into a task list. No matter what I use for the date/time it always seems to be off by and hour or two. I am in EST using my ...
4
votes
2answers
4k views

Enable like function from catalog page via javascript object model - improve this?

The business need is to create a 'channel' page that will display thumbs of videos like a gallery, and I need to enable people to 'like' that content from the gallery page. (Standard disclaimer: I'm ...
6
votes
1answer
7k views

Get List Item Version History using Client Side Object Model (C#)

I am using the Client Side Object Model Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll against SharePoint 2013, and am able to pull down data from custom lists. What I am ...
1
vote
3answers
2k views

Creating a sub-folder in a SharePoint with Client.dll in C#

I am trying to create a list of all the folders that exist within the root folder. From there I want to implement the creation of a folder if the folder does not already exist. Is there a way to ...
12
votes
6answers
21k views

Creating Nested Folders via Client Object Model

I'm trying to create nested folders in my document library so it looks like this: http://site/PublicDocuments/Folder1/Folder2/Folder3/ The document library "Public Documents" exists but none of the ...
28
votes
5answers
55k views

Check if user is in a specified group

I would like to check with JavaScript if the current logged user is in a specified and specific group (for example called "Admins Group"). How can I do? Thanks
0
votes
1answer
152 views

Clear radiobutton list selection using jquery

I would like to clear Radiobutton list selection once user click the button. I have tried the following code but clears the selection in browser. When I access from backend(C#) selection is there. It ...
3
votes
3answers
9k views

Upload list item attachment using JSOM

I am trying to upload list item attachment using the below code. There is no error in the code and all the variables are present with proper values but in uploadFile method it goes to error handler ...
0
votes
1answer
172 views

Rest API filter syntax error

i am getting invalid error on the below error. I couldnt make out what the error was. url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('Mega Menu')/items?$select=...
0
votes
2answers
181 views

executeQueryAsync not working in for loop

I have a function to start a workflow on multiple checked list items. It successfully identifies which items are selected and successfully starts the workflow, however it is only doing it on the last ...
1
vote
2answers
114 views

How to assign personal view to specific user?

Usually I create view using ViewCreationInformation class: public static void Create(this ViewCollection viewCollection, IListView view, string desiredTitle, ContentTypeId contentTypeId) { //...
2
votes
0answers
47 views

Java Script How can I get the Site Owners information and the Group Name for all my sites

I have zero experience coding in SharePoint and have been given the task of showing the current Site owners within an HTML control on EVERY page for our site. I found this code at this link which ...
1
vote
2answers
1k views

How to set up CSOM in Visual Studio?

Our Sharepoint site is on our company servers. I need to create a web app that can retrieve and post data from and to that site. I use VS 2017, I tried to install Microsoft.Sharepoint.Client using ...
1
vote
2answers
1k views

Office 365 document Get a link View Edit URL using C# client object model

I was trying to get the URL of a document (inside document library) link same as Get a Link option with View (account required).I am using following code with sharing options. SharingInfo object does ...
3
votes
2answers
5k views

CSOM OpenBinaryDirect generates 401 error on office 365

I have used same instance of ClientContext inside a RemoteEventReceiver (MinRer.svc.cs) in a provider hosted app to get RootWeb, SubWebs, ListItems and I have added ListItems to lists. It works like a ...
0
votes
1answer
1k views

How to Get list of site collections in a web application using JSOM

I have got a requirement like want to fetch the details of all the site collections in a web application either using JSOM or .net managed client object model? Please provide me those details. ...
1
vote
4answers
10k views

SP2013 online : set_formDigestHandlingEnabled Error

I get the error : Object doesn't support property or method 'set_formDigestHandlingEnabled' when I try to get the current SPContext object from javascript code in an Office 365 site. I am using ...
9
votes
3answers
5k views

Change masterpage from Seattle to Oslo using CSOM, Sharepoint online

Using CSOM and c#, I would like to change the master-page from Seattle to Oslo. Can anybody help me?
4
votes
3answers
4k views

Add multiple people using Javascript Client Object Model to a Field of Type SPFieldUserValue

I want to update a UserField client side. I found the following code at this topic How to Use ECMA CSOM to Set a Field of Type SPFieldUserValue Tried the following code: var users = new Array(); ...
1
vote
1answer
82 views

How to get group by group name in JSOM SP2010?

How to get group object from group name something like this. var groupCollection = clientContext.get_web().get_siteGroups(); group = groupCollection.getByName("Group Name"); Above code will work in ...
2
votes
1answer
3k views

SPServices - GetRolesAndPermissionsForCurrentUser

I have a list where one group of users is not allowed to delete items but they have view and edit permissions. All items in the list contain an attachment. However, users are not allowed to delete the ...
0
votes
1answer
335 views

Page Layout and Site Template Settings - Properties using PowerShell

I have a requirement where I need to access the Site Templates and Page Layouts and the Default Page layout. I'm able to access all the properties using $web.AllProperties["__WebTemplates"] $web....