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

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

0
votes
0answers
11 views

JSOM: set column as list ID [on hold]

I need help in JSOM coding to set column as list ID. I want to set a specific column as list unique ID. How can I do that with JSOM?
0
votes
0answers
8 views

Setting lookup field using JSOM. Error: input string was not in correct format

I have two lists: one of them has a lookup field to the other list. When I try to add value in the lookup field I get an error : input string was not in correct format. Code I am using: var ...
1
vote
2answers
78 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
32 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
21 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
25 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
28 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
37 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
14 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
22 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
20 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
16 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
0answers
17 views

Strange Issue with JSOM List Item Creation and Immediate Retrieval

I came across a strange issue with the SharePoint JSOM API today, and although I have worked around it, I wondered if others have seen it. It's all stock code - item created like so (sample ...
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
37 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
414 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
23 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
44 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
31 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
225 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 ...
0
votes
0answers
16 views

Error when using JSOM search [duplicate]

This error appears: Uncaught ReferenceError: Microsoft is not defined in this line of JSOM code: var keywordQuery = new Microsoft.SharePoint.Client.Search.Query.KeywordQuery(context);
1
vote
0answers
20 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
47 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
29 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
31 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
24 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
28 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
36 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
26 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
28 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
44 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
45 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
14 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
24 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
30 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
91 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 ...
0
votes
0answers
30 views

How to create/update items in a list based on items added/updated in another list based on Created By

I have two lists: Comp Request and Record List. Comp List contains a calculated column called 'Total Credit'. The list itself contains a SP OOTB new item form which user fills in and a flow runs for ...
1
vote
1answer
40 views

Running custom function before SharePoint renders page

Some Background I have a publishing site that presents documents with stylized icons using some custom display templates and views (with CSR). Document icons are rendered using fontAwesome classes ...
0
votes
1answer
22 views

Get last major version of page with all custom field values using JSOM/REST

We want to access last major version of page with all its OOTB & custom fields using JSOM/REST. I can able to get only version number & url only but we need all fields. Please help. Thank ...
2
votes
1answer
31 views

How to pass sharepoint site name dynamically in below working code

I am using below code in SharePoint online. Function loadcompanies takes one argument as projectName and that is used to perform filtering of a list column, it works fine. Currently I am hard-coding ...
1
vote
0answers
20 views

Get Other Label (synonym), description property values of a term set using REST API

I am working with the Microsoft Flow where I need to get the OtherLabel and description property values of a term-set. This term set is attached as file metadata in a document library. I tried, there ...
0
votes
1answer
47 views

Get the ID of a Publishing Page, that just was created in JSOM?

I'm creating new publishing Pages via JSOM and now i need to get the listitem to change some fieldvalues but i struggle to get the ID of the publishing page that i just created in Pages library. ...
0
votes
1answer
60 views

How to remove duplicate values from a list drop-down separately

I am using below JS code to show certain choices in a Company drop-down based on Project Name passed in loadcompanies function for example in below case: Rahway DMV. There is a company list from where ...
0
votes
0answers
13 views

how to redirect users to a specific document library view page depending upon the content type they populate while uploading a file

I have a scenario where for a document library , i have 4 content types as: Lease, Loan, Finance, Admin. Similarly for each of these content types, I have respective views created. View names are same ...
0
votes
0answers
18 views

SharePoint Online, Share to External using JSOM/REST?

Can I share file to external e-mail using js? Currently no way to do it?.. Best regards, Gennady
1
vote
2answers
60 views

How to hide sharepoint column fields on Display form?

I am using below code to hide a field on SharePoint display form but unfortunately its not working. Can someone please help me correct it, thanks in advance. <script type="text/javascript" src="...
0
votes
0answers
18 views

Inserting Record in SharePoint List Prompts for number of records inserted

While I am trying to insert records in a SharePoint List, I have created an alert in OnSuccess function to show the records inserted and then calls a function(Which Sends a notification mail). The ...
0
votes
1answer
31 views

Issue with Date difference in Event receiver, If updates is coming from JSOM and SSOM

We are adding item in list with Jsom and SSOM. Following is the scenario when item is added through SSOM , we have a date field in which date is proper. Once item is added , we have an event receiver ...