Questions tagged [jsom]

Use the JSOM to retrieve, update, and manage data in SharePoint.

Filter by
Sorted by
Tagged with
20
votes
2answers
59k views

ExecuteOrDelayUntilScriptLoaded with sp.js when in debug mode Object Expected

I currently have a JavaScript file that gets loaded in my SharePoint pages. jQuery(document).ready(function() { ExecuteOrDelayUntilScriptLoaded(myfunction(), "sp.js"); }); myfunction = function(){ ...
18
votes
2answers
11k views

How to check whether the current user has edit permission for a particular list using JSOM in SharePoint 2013

I have created a Custom list named Test List. I need to check whether the current user is having edit list permission for Test List list or not, by using JSOM.
15
votes
2answers
3k views

Which one is faster CSOM or JSOM

Understanding which one has better performance for performing CRUD operation in SharePoint List, CSOM or JSOM?
12
votes
3answers
15k views

How to get List name by its GUID using Javascript

I have created a survey list. I need to change the redirection from QstNew.aspx page to Overview.aspx. For this purpose,I require list name to be fetched dynamically. I can get the list GUID from ...
12
votes
4answers
4k views

Using jQuery $(document).ready() in JavaScript Object Model

I've been using with great success the $(document).ready(function() { FunctionName(); }); in a SharePoint WebPart code snippet to fire off COSM CAML queries using JavaScript to build various ...
10
votes
1answer
709 views

Code editor (IDE) for CSOM developement - Sharepoint

I am searching for a code editor with which I can connect to SharePoint library, like I can open a complete library in the editor, edit, save changes, which will be reflected in the library. ...
10
votes
0answers
4k views

How to stop a SharePoint workflow using JSOM

Let me preface by saying that I'm a relative newbie to this SharePoint stuff and am still fumbling my way around a bit learning from code examples where necessary. That being said, I have no issue ...
9
votes
4answers
8k views

Get Parent web of a subsite using JSOM in SharePoint 2013

How can we get an immediate parent web of a subsite using JSOM ?
8
votes
2answers
3k views

create custom permission level in SharePoint Site programatically in JSOM or CSOM

I want to create my custom permission level programmatically name "Only Doc Edit" and want to choose only selected value for them viz. Edit Item, view Item etc.. Is it Possible? If yes, How can I ...
8
votes
1answer
3k views

'ctx' variable in SharePoint

Recently I came across the variable ctx (link) in SharePoint which allows you to get the name of current list/library without any fuss. Apparently the ctx variable has quite few more tricks up its ...
8
votes
1answer
224 views

What is the pros and conts between JSOM and REST

I have a dilemma choosing between JSOM and REST what is better? what are the pros and conts of both? is different in performance? I have search but I cant find something usefull.
8
votes
1answer
1k views

SharePoint 2013- Anonymous users not able to read from Termstore

I have a public facing anonymous site in SharePoint 2013 on Premise. I have written some JSOM to read terms from Termstore .For authenticated users this works fine but for Anonymous users , it throws ...
7
votes
4answers
1k views

JSOM for anonymous users

I am writing a public facing web site in sharepoint 2010 and using JSOM to access data from lists, Things are working and now trying to deploy on production server, server has strict security settings ...
7
votes
1answer
5k views

How to get the current list/library name using JSOM?

How to get the current list/library name using JSOM? So far I found two snippets which return GUID of the current list/library, but not the name. // Using standard JSOM SP.ListOperation.Selection....
7
votes
1answer
397 views

Install app using JSOM in SharePoint Online

We have requirement that SharePoint hosted app need to add/remove in site when site creation(Site has been created using JSOM). I did't find any article regarding add app programmatically using JSOM. ...
7
votes
1answer
391 views

How to find the last Logged-In time for the external user for a SharePoint online Site?

I need to know about the information for the external user last logged-in time over a site. Is it possible to get through REST or Client-Object Modal?
6
votes
4answers
21k views

Caml Query to return items created by logged in user

Using Javascript CSOM and want to return items created by logged in user, but the code below returns all items. Could someone advise? var camlQuery = new SP.CamlQuery(); var specifier = "<Eq>&...
6
votes
2answers
424 views

how to change the default gear icon look in SharePoint 2013?

In the top right corner near the ribbon there have a setting icon in SharePoint 2013. I need to change the Gear icon image?
6
votes
3answers
3k views

Change sort order in returned ItemsCollection

I am fetching a collection of items from a list using a CAML query. The returned items are then populated in my custom HMTL table. There is, however, another HTML table for which I need the same ...
6
votes
3answers
6k views

Query multiple lists using javascript/CSOM

I'm about to query multiple lists using JavaScript (JSOM, SharePoint 2010). It's working when querying one list in a time, but that's annoying when I'm having lots of lists. Working example: ...
6
votes
1answer
1k views

How to call javascript function on Quick Launch Navigation Item click?

I am working with SharePoint Online. I have a requirement where I have to add Quick Launch Navigation Item and call JavaScript function on click of the item. I am using code shown here. Following is ...
6
votes
1answer
2k views

Can powershell script be run using REST API / JSOM?

Is there a way to invoke and execute a .ps1 file using REST/JSOM? I am hoping to deploy a SharePoint Hosted App that runs a powershell script on the server.
5
votes
3answers
1k views

How to pull data from root level site and display in subsite using JSOM?

I have a custom list on root level site in SharePoint Online. I want to display the list data to one of my subsite pages. I am using JSOM. How can I achieve this? Following is my code which gets the ...
5
votes
2answers
529 views

Batch operations in SharePoint 2013

Unfortunately, I am stuck in a SP 2013 world now. I know batch operations (using REST APIs) are only supported in SharePoint 2016+ and in SPO. Pnp Js also has a good batch processing extension methods....
5
votes
1answer
853 views

Missing properties of _spPageContextInfo after page load

I have a script that provision site collections under a specific managed path. In these site collections, I have sub webs with page libraries in which I have several different pages with custom ...
5
votes
1answer
253 views

Get number of views of blog post in Blog Site using Javascript Object Model or Rest API

How to get the total number of views of blog post in Blog Site using Javascript Object Model or Rest API ? Blog Post view will be count only one time for one user.
5
votes
0answers
1k views

Unable to update taxonomy field value using REST API or JSOM

I'm not able to modify taxonomy field values with REST API or JSOM for a specific library. My code works on other lists, but not on this particular library, what can the problem be? The library has > ...
5
votes
1answer
1k views

SharePoint JSOM datetime values in different timezones

I am working on a solution (on SharePoint Online) which is used by users in different timezones. SharePoint site is configured for "W. Europe Standard Time". Following occurs: A user from US creates ...
4
votes
2answers
712 views

how to get a list's add new item URL with JSOM?

I'm trying to figure out how I can get a list's add new item URL using JSOM in SharePoint 2010. This is what I have so far to get if the current user has edit access on the list. ...
4
votes
2answers
5k views

How to retrieve dropdown options list

I'm using JS to create application based on SharePoint. What I have: field in list item, with dropdown and few values that are not list (just few static values). I suppose this dropdown created ...
4
votes
3answers
8k views

Delete all the contents of list using javascript REST or CSOM

I want to delete all the contents of list using javascript I tried REST jQuery.ajax({ url: "/sites/hr/_api/lists/GetByTitle('Groups')/items?$filter Title neq x&$Top=20000", type: "...
4
votes
2answers
4k views

How to resolve “The property or field 'ListItemCollectionPosition' has not been initialized..” error?

I am trying to fetch list items along with its Attachments and display on a SharePoint page using JavaScript JSOM. My code contains the pagination too which is mentioned here. Now, for attachment we ...
4
votes
2answers
5k views

Get the Termset with Javascript and nothing return

We are working on a SharePoint 2013 on-premise farm. I am trying to return the termset object with ID 'xxxxx-xxxxx-xxxxx-xxxxx-xxxxx'. Here is my script. I add a content editor webpart and insert ...
4
votes
1answer
8k views

Set list item level permission in jsom (javascript object model)

I need to assign permissions to a particular list item using client object model in JavaScript.Say for 5th item by id I want to assign contribute permission to a particular group. I have previously ...
4
votes
3answers
7k views

SP2013 javascript client object model - get server time

My client machine and server machine has time offset of 2:30 hours. So when I try to retrieve Date/Time field using JSOM, it gives time according to offset. oListItem.get_item("Modified"); So how to ...
4
votes
1answer
657 views

list 'user information list' does not exist at site with url http://siteurl - SharePoint 2016

I am trying to get the data from User Info list using below JSOM code. but the issue is, it returns the data only when owner group user logged in to the site, for a visitor or even site members are ...
4
votes
1answer
239 views

Check if the user is present in AD group inside Sharepoint Group Sharepoint Online

We have a SharePoint group and inside that group have an active directory group. IS it possible using JSOM to find out if the user belongs to the AD group which is added inside the Sharepoint group?
4
votes
3answers
1k views

Create Link to a Document ( NewLink.aspx ) with JSOM

A customer has a added a content type called "New link to a document", which let users add links to other documents, or any other site. I'm not able to create new items of this content type ...
4
votes
3answers
4k views

Create/Update Task List item “ParentID” column via REST issue

I'm trying to create a list item in a default SharePoint Tasks list, with a specific parent id to create a hierarchy of tasks, e.g. Parent Task --> Child Task --> etc. The internal property "...
4
votes
1answer
513 views

Update custom user profile property using JSOM in sharepoint 2013 on prem

How can I update user profile property using JSOM in Sharepoint 2013 on prem. Any ways will do either by REST or JSOM.
4
votes
1answer
959 views

How to add Previous/Next buttons to SharePoint blogs posts?

How to add Previous/Next buttons to SharePoint blogs posts so I can navigate to previous or next post ?
4
votes
3answers
5k views

Adding a new item to a Document Library Using JSOM

I need to add a new item in a document library using JSOM. The document library also possesses custom columns. I am able to upload file but unable to get proper method to add the custom column values ...
4
votes
1answer
3k views

How to Group by the Column using CAML Query

My requirement is to get the unique values from the column "Month" I am using the below code to group the column "Month" , But I don't find any luck .Can any one tell me what's wrong in my below code ...
4
votes
1answer
627 views

Why do people prefer to use List Item Collection Enumeratror over the get_data method?

I wonder if anyone compared the two methods of handling ListItemCollection data in javascript: var enumerator = collection.getEnumerator(); while(enumerator.moveNext()) {var current = enumerator....
4
votes
3answers
8k views

How to retrieve files inside folder using javascript

I need to retrieve pages that is in the file "Folder". Doc/Folder/ var context = SP.ClientContext.get_current(); var list = context.get_web().get_lists().getByTitle('Doc'); When I do this it works ...
4
votes
1answer
474 views

Connect webparts using CSOM C# or Powershell - Connected Webparts

I have two SharePoint Lists Departments and Users in SharePoint Online. Users list have lookup of Department Title. I want to add List View of Users to Display Form (DispForm.aspx) of Departments. So ...
4
votes
2answers
767 views

Find web part type using JavaScript Object Model in SPOnline

I need to go through all web parts of a page (e.g. default Display page of a list) and set the JSLink property on a particular web part. I can enumerate the web parts on a page and set the property on ...
4
votes
2answers
2k views

Use JSOM to get unique permissions for a folder in document library

I would like to be able to retrieve the permissions for specific folders in a document library via JSOM. Specifically, I would like to be able to use JS to determine if the active folder that the user ...
4
votes
1answer
544 views

JSOM bulk SP.ListItem creation: get created Ids

I'm using this approach to bulk SP.ListItem creation: var ctx = SP.ClientContext.get_current(); var oList = ctx.get_web().get_lists().getByTitle('listTitle'); myObj.forEach(function(d,i) { var ...
4
votes
2answers
2k views

How to check if a Site collection exists using App model (JSOM,CSOM)

Is there a way to check if a site collection exists before creating the site collection? I am doing it using the App/Add-in model. Thanks.

1
2 3 4 5
18