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.

0
votes
0answers
11 views

JSOM get site from GUID

Using JSOM how can get the URL like the powershell script below using the site GUID $web = get-spweb -Site 87d28faf-a0ac-4ac6-80a1-96aca53d07b7 $web.Url Thank you.
2
votes
1answer
26 views

Check if a user is a member of SharePoint group JS REST API using async await

How can I check if the current user is a member of a specific SP Group using REST API and async/await? _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getbyname('" + grpName + "')/...
0
votes
2answers
600 views

Getting choices from choice field in Online using JSOM

I am trying to get all of the choices from a choice site column in SharePoint online. Using the following code I get to the success method but it errors out saying 'field' is undefined. I don't ...
0
votes
0answers
16 views

Loading _Sys_Nav_HoverText with REST

I'm building a SharePoint 2016 app with a custom site map menu that utilizes the site's managed navigation. How do I retrieve the "Navigation Hover Text" value? I'm using the REST API to retrieve the ...
0
votes
1answer
34 views

Inserting dynamic data in a sharepoint list using jsom

I am trying to insert dynamic data (question number, question and answer checked) to a new sharepoint list. The data needs to be read from another list, i.e. "Questions1List". I have a quiz page in ...
0
votes
0answers
24 views

Inserting multiple rows in a SharePoint list using JSOM

Hi I am trying to insert the data in the form of multiple rows to a SharePoint list. I retrieved question number, question, choice answer options as shown in image. Now, I want to insert the question ...
0
votes
1answer
28 views

Use JSOM to retrieve id of newly inserted item

I am using JSOM and would like to retrieve the id of the newly inserted item. I've tried a few things and nothing has worked. Any help you can provide would be much appreciated. var clientContext ...
0
votes
1answer
18 views

SP.js loading issue while retrieving list items using JSOM

Hi I am trying to retrieve list items using JSOM. But, the problem occurring is that SP.js is not loading correctly. It shoul load before the function gets executed. I am confused about where to use ...
0
votes
1answer
612 views

JSOM - Update Star Ratings on Item

I've been attempting to update the rating values (shown as star ratings) for items that I am fetching from a list via REST and displaying in a Content Editor Webpart. I am essentially rebuilding the ...
0
votes
2answers
24 views

Help stopping a SharePoint Workflow with JavaScript

I'm attempting to write a script that will cancel and start workflows when an error happens. I found this section of code on different sites but have not been able to get it to work. After stepping ...
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 ...
0
votes
0answers
19 views

Accessing the Secure Store Service using client-side code

Using JSOM or REST can I access the credentials in a Secure Store Service? I have a on-premise SharePoint 2016 Enterprise farm. And it will be accessed internally from a windows domain
0
votes
1answer
25 views

Can I use elevated permissions using JSOM, CSOM, or REST?

I am working with an On-Premise SharePoint 2016 farm and I am looking for some way to elevate permissions, so I don't use the logged-in user's credentials but another set of permissions that the ...
1
vote
0answers
12 views

Create a replica of the list from root site to subsite using JSOM Approach

we have requirement to copy the list items from root site list to the subsite list using JSOM/Rest Api Below are the reasons for which we are going through this option ' Our environment does not ...
0
votes
1answer
676 views

Error: Object not associated with an object identity

After newly creating a content type via JSOM, I'm getting the following error when calling contentType.update() or context.load(contentType): The object is not associated with an object identity or ...
0
votes
1answer
637 views

web.getList() retrives all lists. Instead of this I want only user created list

I am making Sharepoint hosted app and I am trying to get all lists appContextSite = new SP.AppContextSite(context, hostweburl); this.web = appContextSite.get_web(); //Code to get the cross domain ...
1
vote
1answer
640 views

How to JOIN two lists by lookup column in Sharepoint Online

I'm a newbie in javascript and i'm using jsom to retrieve list items in Sharepoint Online. I have two lists BnzPersons and Sessions. This is my first code variant: <div id="divListItems"></...
0
votes
1answer
638 views

REST API return encoded Multiline Textfield but show it correctly

I save a JSON string in my SharePoint list. This looks like: {"columns":[{"name":"A","visible":true,"width":200,"sort":{},"filters":[{}],"pinned":"left"},{"name":"B","visible":false,"width":150,"sort"...
0
votes
1answer
25 views

How to open an Excel file in Excel online on button click in SharePoint Online?

I need to open an excel file in Excel online on a button click which I retrieves from Document library . I have followed this, but it shows me an Error page like 'Item does not exist. It may have ...
0
votes
0answers
18 views

How to share SharePoint online page on social media?

How to share SharePoint online page on social media (Facebook, Twitter and LinkedIn) programmatically (JSOM or REST API) so that everyone (external users) can see the content of this page without ...
0
votes
1answer
32 views

RangeError JSOM set_item update

I tell you that I have been fighting with this bug a few days ago. He is winning ... On the EditForm I have a grid that points to another sherpoint list. I can add listitems to that other list or edit ...
1
vote
2answers
661 views

SharePoint Designer 2013 Page accessing ClientContext issue

I have created a new aspx page from SharePoint Designer 2013 and I have following scripts added on my page head section. The page does not belong to any app, it is separate Wiki page, added from ...
0
votes
2answers
708 views

How to get sharepoint file from document library if I know file url (JSOM)?

I have url like "http://test/site/subsite/docslibrary/filename.doc" I need to get one of custom columns of file in future, so need access this file in sharepoint. Thank you
0
votes
1answer
17 views

How to set multi value metadata list field using jquery?

How to set multi value metadata list field using jquery? I am trying to update the vaule by passing term name and term ID. I am able to save single value but throwing error with multiple values: ...
0
votes
1answer
28 views

remove all users from a SPGroup on Save button click in NewForm.aspx using CSOM/REST

on save button click of my newsplist newform.aspx, i need to remove all the users from the custom spgroup. i tried with REST API, but there is no method to delete all users from the group! its allows ...
1
vote
1answer
735 views

Files move from one library to another library using jsom

Below code is working fine, but inside for-loop if I put alert,then moving multiple file but if I remove, only one file moving. I do not want any alert/pop up. Please suggest. ...
0
votes
2answers
108 views

How to get all users (name, id) from a SharePoint group including AD groups with JavaScript?

Is it possible to retrieve a list of all members of a sharepoint group, including members of included Sharepoint/AD groups using JavaScript? As far as I know it is not possible using client side ...
0
votes
1answer
28 views

How to get comments of item by using CSOM 2013?

I retrieve all items by using this code: var oList = context.Web.Lists.GetByTitle(title); CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = "<View Scope=\"RecursiveAll\"></View>";...
0
votes
1answer
35 views

Can i get distribution list of current user in SharePoint using JSOM or REST API

I have written a logic to check if the current user belongs in a Specific SharePoint Group e.g. "Visitors". However this user is present in the DL and the DL is added in the SP group, e.g. DL-Org. The ...
2
votes
1answer
771 views

Sharepoint CAML IN operator not working with FileDirRef

I want to retrieve a list of file from two folders. When I combine two <Eq><FieldRef Name="FileDirRef" />... with <Or> it works fine. When I want to use the <In> operator it ...
0
votes
2answers
46 views

Export SharePoint online list to Excel

I know there is an OOTB functionality to export list into .iqy file that can be opened in Excel. But here we want to export the list using JSOM/REST to a file which has .xls format. I have gone ...
0
votes
1answer
19 views

How to set all one column's default values to 0?

I have a document library in our site. I have a column and I want to set the column's default value to 0 at first. But it is empty. My column is integer column that stores numbers. How can I do ...
1
vote
2answers
742 views

Javascript Disable event receiver firing

Are there any ways to disable event receiver firing by javascript for a list during updating data?
0
votes
0answers
21 views

2016 - SPField.FieldRenderingControl equivalent to CSOM or JSOM

Using the Microsoft.SharePoint, I can render SP Fields in custom application page using the below server side code. BaseFieldControl editControl = field.FieldRenderingControl; editControl.ID = field....
1
vote
1answer
56 views

Export multiple lists into a single CSV file

I have a requirement to fetch 2 large lists and merge data into a single CSV file. Suppose Lists are as below : List A Column1 Data1 Data2 List B Column2 Data3 Data4 Then Data should be displayed ...
2
votes
3answers
5k views

REST API Filter by LoginName from user list not working

I have a list A, which has a column owner of type "Person or Group". I am using REST API to query this list(using jquery). I would like to use column owner to filter records by username. I have a ...
2
votes
1answer
807 views

How to copy a file from one site collection to another site collection using JSOM ,in a Sharepoint Hosted app?

I have to create a sharepoint hosted app (Office 365) for copying a latest version of a file from one site collection to another site collection under the same tenant, using JSOM. Can someone direct ...
2
votes
1answer
859 views

Remove list item permissions by role type using JSOM

I'm looking for a good way to remove all list item permissions on a certain list item of a specific role type using the JavaScript object model. With myListItem.get_roleAssignments().getByPrincipal(...
1
vote
2answers
912 views
3
votes
0answers
78 views

Cancel a paused workflow with javascript on edit form

I have a SP2013 list item running a SP2010 Platform Workflow. The workflow will pause until a specified date then perform some actions. This workflow should be started when an item is created and ...
0
votes
1answer
856 views

Uncaught TypeError: web.get_url is not a function

When trying to execute the following code i got the mentioned error. Here is the snippet: var clientContext = new SP.ClientContext.get_current(); var web = clientContext.get_web(); clientContext.load(...
1
vote
2answers
55 views

Change Sharepoint group setting using JSOM or REST

I am looking for JSOM or REST option to update SharePoint user group settings who can edit the membership for the group.
1
vote
2answers
86 views

Beginner question on Updating List Items using JSOM, REST and Sharepoint Online

After doing a lot of research on REST, I'm stuck. Any help would be appreciated. I want to users to be able to update the status of a Task by clicking a button which takes them to a url. The column ...
0
votes
1answer
905 views

Overwrite with SP.MoveCopyUtil

I can't get the overwrite paramreter in SP.MoveCopyUtil.copyFile to work. I can't find any good documentation on it either. Heres the code. appObj.copyFile = function (source, path, fileName) { var ...
1
vote
0answers
25 views

Activating PublishingSite feature times out and returns error but succeeds

I am trying to use JSOM to programmatically activate the SharePoint Server Publishing Infrastructure feature at the Site collection level: I ran the following script: var publishingSiteFeatureId = '...
1
vote
1answer
42 views

How to fetch version history of list item and display in a list

I have requirement where I need to fetch the version history of each list item and display in a separate list where a specific column value has been changed. For Example: I have list named "Demo" and ...
0
votes
2answers
1k views

How to add the custom Data to calendar list in sharepoint 2013?

I created the Customs Form as a web part, In that form, there have Several Fields like Title, Location, Date and Time picker, Description, Images and URL. After Filling the Form, a user clicks publish ...
0
votes
1answer
1k views

How do I get all current users from a site

I need to get all currently active (not removed users) from a site. I have the following JS that gets all the users but some of them are old users that have been removed from the site (still exists in ...
2
votes
1answer
1k views

Request failed: unexpected response data from server null

I have to develop a page for SharePoint 2013 where I am retreving data from a list and showing it. I have a list called Test , below is my code to retreive data from list. function getDataValue(...
0
votes
1answer
1k views

SharePoint client side people picker

When I am creating a client side people picker,it is working fine when I am pasting the name or email ID on the textbox. But when i am writing in it, it won't work and no clues are coming for the ...