Stack Exchange Network

Stack Exchange network consists of 174 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
27 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
48 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="...
-1
votes
0answers
17 views

SharePoint Bootstrap Form [on hold]

I have used below code to create a form in SharePoint using bootstrap: <script type="text/javascript" src="/_layouts/15/MicrosoftAjax.js"></script> <script type="text/javascript" src="/...
2
votes
1answer
43 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
47 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
49 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
37 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
72 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
37 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
31 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
27 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
59 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
75 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
45 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
28 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
31 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
501 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
55 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
23 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
45 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
118 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
45 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
0answers
22 views

debugging SharePoint JSOM, client side code in the F12

though its not a programming question,i would like to know how to debug the SharePoint code that's written in JSOM, REST API,or spservices. i tried to put console.log etc etc for the values spweb , ...
0
votes
1answer
23 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
28 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
18 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
55 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
429 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
29 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
88 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
42 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
228 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
25 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
29 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
121 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
44 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 ...
0
votes
1answer
45 views

JSOM - Page Approval with JS

I write down a JavaScript to reset news likes. It is working properly. But I need to checkOut the file while trying to edit news properties. ResetNewsLike = function () { var pagesListItem = ...
0
votes
0answers
38 views

How to return the last item modified from each queried list using Search query api?

I would like to query all lists across different site collections based on a specific content type, but getting only the last modified item. Using Rest api and caml query, can be achieved, but that ...
2
votes
1answer
34 views

calculate total of group in grouping view of splist

I need to calculate the number of group in my grouping view of SharePoint list. we can also calculate the number of different value in the column. Any idea how we can do that using JSOM.
0
votes
1answer
42 views

Rating Feature not disabling on SPO Pages - SharePoint Online

I have a requirement where Admin will have the ability to turn ON/OFF the rating feature for SPO Pages and the UI Control should be able to display/hide based on the setting. Steps for turning ON ...
0
votes
1answer
30 views

The getLimitedWebPartManager is not a function

In the context of my previous questions: Updated the selected view in list view webpart how can I get the xml format for my list view web part I encountered an error when running this line: var ...
0
votes
0answers
25 views

How to add Item e.g. Title, Name, Attachment in List

How to add Item in my attachment script e.g. Title, Name.** I am using this script for attaching file.. Problem is how to add the title and name for another field to add in a list. This is my script. ...
1
vote
1answer
45 views

how can I get the xml format for my list view web part

I need to add a list view web part in web part page using JSOM, I don't know how can I generate the XML for list view, not the content editor var siteUrl = '/sites/MySiteCollection'; var ...
0
votes
1answer
60 views

Context.ExecuteQueryAsync not trigerring

I am debugging the code below and the line Context.ExecuteQueryAsync is not being trigerred. I am not getting any error. async function updateListItem(listName, itemId, itemProperties, pageurl, ...
3
votes
1answer
53 views

Updated the selected view in list view webpart

Good morning, I have awired issue to reflect the changes in list view to list view webpart in web part page programmatically using JSOM What exactly I need to change the selected view in list view ...
0
votes
0answers
16 views

Getting list of users (with email addresses) under a shared generic mailbox used in Sharepoint

I'm just wondering, is there any way to get user names and its corresponding info (i.e. email address) from a shared generic mailbox that is being used in permissions group in Sharepoint via ...
0
votes
1answer
25 views

How to add time stamp in addition to user name profile property

I am using below code with reference to this thread: Yes/No (check box) - who updated field on the custom list item Basically when a user checks on a yes/no column, it shows/prints the user name who ...
1
vote
0answers
44 views

Custom list template not getting applied while creating List using javascript in SharePoint 2013

I am creating SharePoint list using Custom list template using javascript. and I am able to create new list successfully. but this new list is not using custom list template. it has only Title column....
0
votes
2answers
120 views

get items from a image library and bind using foreach loop with multiple HTML image ID using JSOM

I am trying to create an image slider using JQuery where I am facing difficulty to bind multiple images to HTML labels. As I have already used in while loop how to use this using for each loop to ...