Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jsom]

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

19
votes
2answers
53k 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(){ ...
15
votes
2answers
7k 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
2k 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
3k 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
3answers
11k 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 ...
10
votes
1answer
667 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. ...
9
votes
4answers
7k 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
1answer
2k 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
211 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
0answers
3k 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 ...
7
votes
1answer
4k 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
2answers
2k 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 ...
7
votes
1answer
358 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
339 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?
7
votes
1answer
861 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 ...
6
votes
2answers
315 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
4answers
958 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 ...
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
5k 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
658 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
1k 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
737 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
1answer
727 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
185 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
874 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
4answers
17k 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>&...
4
votes
2answers
623 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
2k 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
2answers
4k 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
3answers
6k 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
213 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
729 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
1answer
7k 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
1answer
404 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
650 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
1answer
1k 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
3answers
4k 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
3answers
4k 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
2answers
458 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
1k 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.
4
votes
0answers
298 views

Using JSOM calls with Angular 4

I have to port an AngularJS app to Angular4 which now uses promises and have no clue how I can use this with the executeQueryAsync() method from JSOM. I have also not found any documentation to this ...
4
votes
0answers
109 views

SharePoint Online JSOM Problems adding new item with Managed Metadata field

Hoping someone might be able to shed some light on a problem I'm having adding new items to a SharePoint Online list, using JSOM? I have modified some code I found here on stack exchange, the code ...
4
votes
1answer
240 views

Get Subsite context from Root Site SharePoint Hosted App

I'm creating SharePoint Hosted App to create sub-sites for users. After creation I've to modify the user permissions on newly created Subsite. I'm trying following code. function createSite() { ...
4
votes
0answers
229 views

What are _spPageContextInfo.fid and _spPageContextInfo.nid in SharePoint 365?

I am getting values as shown below while executing _spPageContextInfo.fid and _spPageContextInfo.nid in the console in my SharePont 365 site but am not getting for what these values are used here. ...
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
3answers
749 views

How to call `showWaitScreenWithNoClose` while calling `AJAXRefreshView`?

I am using the code snippet from this link to refresh the view. It works perfectly fine. // Set Ajax refresh context var evtAjax = { currentCtx: ctx, csrAjaxRefresh: true }; // ...
3
votes
4answers
19k views

Get User object from Person or Group field value using JSOM/JavaScript API

How do you get a User object from Person or Group field value using JSOM/JavaScript API? I am looking for something like this (See Vadim Gremyachev answer), but let me be clear I DO NOT WANT the ...
3
votes
1answer
96 views

SharePoint hosted-add in save date object in list

What is the best way to save date object in SPO list with JSOM? because date where is saved is not correct This is my code(experiments) //This is my date string where i get from datepiker - **25/01/...
3
votes
1answer
471 views

Display SharePoint list Hyperlink column Value Using JSOM

I am displaying the SharePoint List items based on ID value using JSOM. And among the list columns there is "Hyperlink" column which is showing the value as "[object Object]" when retrieving Can any ...