Questions tagged [jsom]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
15 views

item is undefined in SharePoint Online but works fine in SharePoint 2013

Long story short I'm migrating SP2013 to SPO. Unfortunately the code is producing an error in the browser console that collListItem is undefined. All I did was to replace the addresses where needed ...
0
votes
0answers
20 views

Validate user name and password in custom edit form in Sharepoint online

Existing Sharpoint 2013 on premise system list has a Infowise signature component. Infowise adds custom column which validate user name and password on saving list item. Since we are migrating the ...
0
votes
1answer
25 views

Permissions for CSOM & SharePoint Online?

I'm working to upgrade an existing on-premises SharePoint site to a SharePoint Online site. The existing site uses a lot of code (both JS and .NET code) talking to the on-premises site via JSOM, CSOM,...
0
votes
0answers
24 views

Parse restricted csv file into CEWP

I have a page with CEWP. I am parsing a csv file (with js) from Documents library and displaying selective data in CEWP. CEWP works only if I give permissions to read the csv file or else it returns ...
0
votes
0answers
41 views

Dynamic Filtering of Document Library using Buttons

I have a SharePoint Library with 100k+ records with the following fields: Market (about 10 different choices); Market Unit (about 10 Market Units per each Market); In order for a user to find a ...
0
votes
0answers
23 views

Get list of all users & groups having access to single folder, subfolder, file

I spent over 3 days to find a way to retrieve list of all users/groups having access to any single file, folder, subfolder (with type of access) but could not find a solution for client site which is ...
0
votes
0answers
12 views

Find the file size when uploading the document in sharepoint library using Javascript object Model

I am uploading the Document to SharePoint library while uploading I need to find the file size , if file size More than 100 Mb I need to skip one functionality. This need to wrote in Js file and add ...
0
votes
1answer
113 views

AddListItem is not populating the List in SP2013

I have a knowledge check in HTML form, so I cant inject into CEWP or SP pages. It needs to be JS, CSS, and HTML. How do I populate a list if someone completes a Knowledge Check? It will add the score, ...
0
votes
2answers
36 views

Unable to Access multidimensional array elements of SharePoint CAML query

The following code outputs a comma separated array for the var cats. The array has six items as the list "banner" has two columns and three rows of items. I can access the array items in the ...
1
vote
0answers
38 views

FIXED - Change Sharepoint Term IsAvailableForTagging property

I'm trying to change the property "IsAvailableForTagging" to false from some terms using JSOM, but when i try Term.IsAvailableForTagging = false or Term.IsAvailableForTagging = 'false' ...
0
votes
1answer
15 views

call executeQueryAsync mutliple times and add results into an array

I am trying to get the Files Urls from selected documents. I am using SPContext to make a call and then using a callback function to push results into an array then later in the code I loop through ...
0
votes
1answer
37 views

Add List Item with JSOM returns “Unknown Error”

Having some trouble with a very basic use of the JSOM controls for adding list items. My code: function submitClick(who, where, when, description, name, number) { //alert(who + where + when + ...
0
votes
0answers
17 views

Change icon of a folder via JSOM/REST

SP2013 on-premise: I sporadically happens that a document set gets created and is displayed with a folder icon rather than a document set icon. Does anyone have a JSOM/REST snippet to change a ...
0
votes
0answers
28 views

Project Server - Updating notes on a task through REST/CSOM

I've been racking my brain over this for a while and Googling has failed me so I was hoping I could get some help here. I just want to be able to update the Notes field on a Project Task in Project ...
0
votes
1answer
27 views

Call a Function on SharePoint Online Site Title Change

I have a requirement to call an API whenever the site Title is changed in SharePoint online. Can someone help me on how to implement this requirement.
0
votes
0answers
38 views

SharePoint 2013 Workflow - App Permissions using java script

I have created a SharePoint 2013 workflow and using App Step in the workflow, I have saved the site as a template and created a new site using the JavaScript object model. The SharePoint 2013 workflow ...
1
vote
2answers
49 views

Sharepoint list: Unable to populate field using variable value

I am trying to populate the list column with calculated value in code below. While the alert & messages show the value being assigned to variable correctly but somehow field is not getting ...
0
votes
1answer
18 views

How to query calendar items from different calendar views?

I have two different calendar views: View Name is "All Events" .../Lists/CalendarName/AllItems.aspx View Name is "Current Events" .../Lists/CalendarName/MyItems.aspx I'm only able ...
0
votes
0answers
16 views

Update values in infopath form library programatically

Is it possible to update the value of a form library using JSOM or rest api? I tried and I get success messages but once I go to the form library the values remain unchanged. If anybody has any input ...
0
votes
3answers
24 views

Add multiple Fields For the CamlQuery in Sharepoint Hosted App

I am trying to filter two fields or more that is clean of null values. It works for the first field but it is not working for the second field: <View><Query><Where><IsNotNull>&...
0
votes
1answer
24 views

How to query SharePoint items that contain one or more text values CAML?

I want to query for SharePoint items that contain at least one or more specified texts. For example, I have a field called "Pets." A SharePoint item would have a value that looks something ...
0
votes
0answers
30 views

SharePoint 2013 create item and return ID returns -1

I am creating an item in JSOM, SharePoint Designer 2013 for SharePoint on premise, and the same code that works fine for SharePoint online clients is not working fine now it keeps returning ID -1 for ...
0
votes
1answer
41 views

Assign read and admin roles to the users on a list item in SPOnline using JSOM

I am now inheriting the permissions as I only have two groups which is group1 which has full control already and the other group is domain group which is everybody in the org so I removed that group ...
0
votes
1answer
24 views

JSOM: get_isSiteAdmin () is not distinguishing between users and administrator of site collection

if (user.get_isSiteAdmin()) { document.cookie = "licence=yes"; } I am using user.get_isSiteAdmin() but its always giving value false I can not give "...
0
votes
1answer
29 views

Cannot set properties of default fields on SP.Folder item with JS

I'm working on code to create and set properties of folders in SP 2013 with JSOM. My current setup involves the following: var ctx = new SP.ClientContext.get_current(); var list = ctx.get_web()....
1
vote
2answers
47 views

CAML Query not display in Sharepoint2013

My end goal is to display items from SharePoint 2013 list that is more than 60 days from today and status is in process. This is my first time using CAML Query in JavaScript. I am not able to have the ...
1
vote
1answer
19 views

Why does the SP.SOD.executeFunc function not work properly?

I use this code to compare two dates, the date of today and the date in the list item. On the screen the dates look fine but when I check them in the debugger the dates are way off. Some are even one ...
0
votes
1answer
110 views

Can a user who is not a SharePoint Online administrator create a site collection with a template other than communication site or team site?

I have a user who I do not want to promote to a SharePoint Administrator, but I do want to allow them (because they are a developer) to create site collections with the template DEV#0 without having ...
0
votes
1answer
18 views

Provider Hosted App-Not able to get data from list using JSOM or Javascript in sharepoint 2016 On-Premise

My Provider-Hosted App published and hosted on IIS with https. The URL is like: https://localhost:44343/Pages/Default.aspx?SPHostUrl=http%3A%2F%2Fecontent&0319c41%2Eecontent%2Eelibrary%2Eapps%...
2
votes
2answers
587 views

Uncaught TypeError: Cannot read property 'apply' of undefined at Array.<anonymous>

I want to retrieve all the lists title of my SharePoint site and add in them into a list. But the error "Uncaught TypeError: Cannot read property 'apply' of undefined at Array." appeared in ...
0
votes
1answer
47 views

SharePoint 2013 JavaScript tag cloud throws site error

I am deploying the script below on a SharePoint site via content editor web-part. The script works fine but it leads to the site not functioning properly and the browser console throws the following ...
0
votes
2answers
537 views

REST API to get all site collections in sharepoint tenant [duplicate]

Can we use REST API to get all site collections in sharepoint tenant.? I don't want powershell script basically i want to bind all asite collections to a dropdown. my code looks like bleow.
0
votes
1answer
50 views

SPFx WebPart - SP.Runtime.js evaluation takes a long time

I have an existing JSOM web-part which reference the SPO runtime: , "sp-runtime": { "path": "https://abc/_layouts/15/SP.Runtime.js", "globalName": "SP", "globalDependencies": [ ...
0
votes
2answers
52 views

SPFX JSOM - call a named function from executeQueryAsync

Apologies in advance for the newbie question as I believe this is actually a fairly simple issue. I am using JSOM and in my WebBart.ts file have a named function that queries a list and produces front-...
0
votes
1answer
33 views

Change one SharePoint site link in the Global Navigation redirect to another site for all users except one

For example, a site in the global navigation, when clicked should redirect to another site for all users except one. Also, users who have saved the site as bookmarks should be redirected too when they ...
1
vote
2answers
21 views

Unable to save all users into SharePoint list

I am creating a list item using the code below: var context = new SP.ClientContext.get_current(); var dfd = $.Deferred(); var targetList = context.get_web().get_lists().getByTitle(listName); ...
0
votes
1answer
170 views

Can I use Modern Script Editor and JSOM to get items from a list?

In SharePoint Online is it possible to get info from lists and users by adding Modern Script Editor Web Part to a page and writing javascript code? I've found a few examples but none of them have ...
0
votes
2answers
80 views

Retrieve user info from azureAD profile

Could anyone suggest some way to retrieve user info from AzureAD using JSOM or REST API only..
1
vote
1answer
27 views

Login name of current user by JSOM

I have a SPFeatureReceiver that adding to calendar item new button in ribbon: SPUserCustomAction getTheTerm = list.UserCustomActions.Add(); getTheTerm.CommandUIExtension = $@" <CommandUIExtension&...
1
vote
2answers
37 views

SharePoint get_item(“my_note_field”) is null for some and not for others

I have built a SharePoint app that allows users to construct a query, run it, and export the results as an xlxs file. It seems that all the parts of the app work exactly as I intended, with the ...
0
votes
2answers
27 views

are there any sharepoint js core libs source maps around?

I see that we can download the debug versions of the js sharepoint libs. https://static.sharepointonline.com/bld/_layouts/15/16.0.19925.12013/core.debug.js Since running them from Sharepoint online ...
1
vote
1answer
43 views

args is undefined on executeQueryAsync query failed

I'm trying to make a JavaScript query on SharePoint 2010 via the following code. On query success I got no problem, but if query fails I get "args is undefined". All examples I see works same way I ...
0
votes
1answer
40 views

Can't get Organization Name from AD

Good day, I have a question with getting user profile data from AD by JavaScript for SharePoint Display Form. I can get user Department by script: <SharePoint:ScriptLink ID="ScriptLink2" name="SP....
0
votes
1answer
81 views

Get SharePoint user ID from name or email using JavaScript

I am building a JavaScript web part that queries a SharePoint list and generates a report based on the list data. I want to be able to get the user ID for a given user by their name or email. input - ...
0
votes
1answer
33 views

SP.MoveCopyUtil unavailable for use (SPO JSOM)

I am trying to use JSOM to programatically move existing files in a document library to a document set within the same library. I think I should be able to use SP.MoveCopyUtil.MoveFile for this ...
0
votes
1answer
60 views

Create new file, “The file *** is not checked out”

I get the error The file "Style Library/FILENAME.js" is not checked out. when uploading a new file (FILENAME.js) using the following code. var uploadFile = function (sourcefolder, scriptName) { ...
0
votes
3answers
47 views

Why does my oListItem.get_id() return -1 even though executeQueryAsync succeeded on creating of list item?

I created a function that adds an oListItem with some lookup columns as shown function on_click(){ console.log("creating new assessment") var siteUrl = _spPageContextInfo....
1
vote
1answer
27 views

How can I fetch only AD groups not SharePoint Groups with REST API or JavaScript?

I want to fetch the a user's membership and AD groups (Not SharePoint Groups). So, how can I fetch the data using REST API or JavaScript?
1
vote
1answer
51 views

Read Comments in Tasks via JavaScript

I am trying to read the comments of a task list in SharePoint 2016 by using JavaScript. Right now I get the latest comment using: var comment = oListItem.get_item('Comments'); But how can I read ...
0
votes
0answers
34 views

When to use JSOM over REST API

Is there any specific scenario where I should use JSOM instead of REST while doing SharePoint development? I want to know is there any limitations for SharePoint REST API when comparing to JSOM.

1
2 3 4 5
18