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
1answer
22 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
28 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 ...
0
votes
1answer
16 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 ...
0
votes
1answer
26 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
27 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 ...
0
votes
2answers
37 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 ...
0
votes
0answers
19 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
48 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 ...
3
votes
0answers
74 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 ...
1
vote
2answers
51 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
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
1answer
36 views

Build caml query in javascript in sharepoint designer

<script type="text/javascript"> $(document).ready(function () { var listName = "Leave Request"; var context = new SP.ClientContext.get_current(); var list = context.get_web()....
0
votes
1answer
52 views

Retrieve items from a SharePoint All list using JavaScript Object Model (JSOM)

How do I get list item ( 4 list ) using the javascript object model? Relevant code as follows : <script src="/JS/jquery-3.0.0.min.js" type="text/javascript"></script> <script type="...
2
votes
1answer
81 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 ...
0
votes
1answer
82 views

Export sharepoint list items to excel by passing item ID as parameter using javascript

I have multiple filters on the page which gives me results, My objective is to provide an export link somewhere on the page which should have url with Id(s) as the parameter, thru which user can ...
1
vote
0answers
51 views

JSOM - Load items with fields

I've got an issue when loading data with the jsom (JavaScript). I've included all fields, I want to load: this.context.load(this.items, 'Include(ID,DocIcon,LinkFilename,FileRef,FileLeafRef,Title,...
0
votes
2answers
92 views

Check if People picker has any value on document.ready of EditForm.aspx in jsom sharepoint 2013

I am trying to set a Person or Group field value only if it is null. I am checking this on document.ready() of EditForm.aspx of listItem, where If its null, then I want to set its value to currentUser ...
1
vote
2answers
83 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
73 views

Date range filtering in a list using JSOM

I want to add a date range filter on a list/library. I tried with the out of box date filter web part but it is causing some issue as search box disappeared & no items in the list if the value is ...
0
votes
1answer
72 views

Spfx dropzone component

I am using the sample react-file upload sample and upon and upload am changing the metadata of the file. The catch is it is working when am testing and when the app is deployed it no more works.The ...
0
votes
1answer
31 views

Can someone help me on how to handle CORS to access other site collection in SharePoint online?

Scenario: I have one Site Collection in abc.com domain and other Site Collection I have inside xyz.com domain. Now I want to access list item from abc.com domain inside xyz.com domain. Both Sites are ...
1
vote
1answer
110 views

PreSaveAction for Quick Edit Mode

I have build some scripts running in the PreSaveAction function for example to validate some data or conditionaly send an email via ajax call. Now I need this functionality when the user creates a new ...
1
vote
1answer
165 views

How to get ClientContext in Sharepoint Online with JSOM

var context = SP.ClientContext.get_current(); throws this error, Uncaught ReferenceError: SP is not defined the snippet works fine in SharePoint 2013, Are there .js that I need to load? if yes, ...
1
vote
1answer
57 views

How to get item ids when using JSOM (when not it in content.executeQueryAsync)

is it possible to get item ids when not using executeQueryAsync. See my code below. I would like to get the item ids as i'm doing below in successGetListItemId() but would like to store in an array ...
2
votes
2answers
37 views

Display account info in SharePoint web part

can we get the user profile details in web part using JSOM I am looking for a profile web part to show this info user profile image user email user job title user extension any help would be ...
0
votes
1answer
37 views

Dynamic calling function to read data from SP List

I'm trying to do something similar to this, but with a dynamic calling function name so that I can reuse the function. I followed Danny's suggestion, but I am getting the error: Uncaught TypeError:...
1
vote
2answers
571 views

how to get the user profile properties of the user who has modified the item in the display form?

we have requirement to customize the display form. we need to show user profile properties for the user who has modified the item in the display form. any help would be appreciated.
0
votes
2answers
104 views

How to create a list item using javascript

I found some code to put a stopwatch on a site page. I want the user to enter their name and the task they are performing and start the timer. When they stop the timer I want the Name, Task and Time ...
0
votes
1answer
25 views

SharePoint JSOM display next 6 items on each scroll event

We have a requirement to show 6 items from SharePoint list on scroll event. That is: On each scroll event we need to show the next 6 items in a div section Has anybody worked on this type of ...
2
votes
2answers
83 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....
0
votes
2answers
384 views

SharePoint online add user custom action to run javascript on all the pages in a site collection

How to include javascript function as a user custom action on every page in a site collection? how can we achieve this using JSOM?
0
votes
1answer
66 views

perform custom validation on custom html form against sharepoint list

How to write the custom validation using jQuery in custom HTML form? I have created a custom html form which has fields dropdown, single line of text, people picker,date, etc. and custom submit ...
0
votes
1answer
25 views

Automatically set value for certain fields in the new form before check in activity for the document library new form

we have a requirement to automatically fill certain fields, before the check in activity for the new form of the document library, how can this be achieved? it seems like the new form of the ...
0
votes
1answer
36 views

Get list item values from SP.FileVersion object (JSOM)

Using the following JavaScript function, I am able to get all versions of a specified list item: function getListItemVersions(listTitleOrId, listItemId) { let context = null; let web = null; ...
1
vote
1answer
19 views

Return the number of not chosen items in a list

I have a list with two choices: "<Field Type='Choice' Name='Result' Format='RadioButtons'> " + "<Default> </Default>" + "<...
0
votes
1answer
20 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(); ...
2
votes
1answer
131 views

Populate people picker during PreSaveAction

I'm in a SharePoint 2013 on-prem farm. I have a people picker field called Managers that I want to populate based on users in another people picker field. Once the user clicks Save on the New Form, it ...
3
votes
2answers
457 views

How to use jquery promise in JSOM

I have code like this (Default.aspx): <asp:Label id="LabelA" runat="server" Text="0"></asp:Label> <script type="text/javascript"> document.getElementById('LabelA').innerHTML = ...
0
votes
1answer
33 views

JSOM Get list count

I have this code (in App.js file): var verificheList; var ctx = SP.ClientContext.get_current(); var hostWebURL = decodeURIComponent(getQueryStringParameter("SPHostUrl")); var verbaleList; var noop = ...
1
vote
2answers
169 views

JSOM Error: unable to get property 'apply'

I get an error after attempting to update an item SharePoint 2013. This one is a bit of a challenge since it's referencing a different file. var siteUrl = _spPageContextInfo.webAbsoluteUrl var ...
1
vote
1answer
68 views

JSOM oListItem is undefined

I am using JSOM to update an item in a list, which I've had no problem with in the past. But for some odd reason I'm getting an error that I'm not sure about. Maybe I'm overlooking something small. ...
0
votes
1answer
231 views

SharePoint 2016 Help with SP.FileCreationInformation and clientContext.get_web(); using JSOM

I need to copy a document to a document set using JSOM. The below code create the file in my Document library succesfully. However I cannot figure out how to go a step further to change from document ...
1
vote
0answers
30 views

_spPageContextInfo.userTimeZoneData suddenly stop working

I am using many _spPageContextInfo properties in my development and it works well but suddenly from last few weeks_spPageContextInfo.userTimeZoneData is not working. User has updated timezone ...
0
votes
1answer
31 views

get my posts count in discussion board

how can I get my posts count that I have posted in the discussion board using JSOM or REST API and show the count in HTML div tag
2
votes
1answer
257 views

Save to draft button in SharePoint

I have a request to add a save draft button in a new form! how to add this button using javascript and when the user clicks it update list item field Draft to yes?
0
votes
1answer
71 views

How to add SharePoint group in Person or Group column using JSOM

I found many articles on how to add user in Person or Group column using JSOM, but i couldn't find any article which shows how to add SharePoint group in Person or Group column using JSOM. Could ...