Questions tagged [jsom]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
32 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
14 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
34 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
22 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
24 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
37 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
48 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
16 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
15 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
16 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
22 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
20 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
43 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
82 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
414 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
0answers
20 views

How to import and export document-set in JavaScript to move/copy it in different libraries

I am trying to use export and import document set using JavaScript (JSOM) to move/copy it between libraries. I am using reference to "SP.DocumentManagement.js". I am stuck with not being ...
0
votes
1answer
43 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
324 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
36 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
44 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
27 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
114 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
41 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
36 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
33 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
58 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
30 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
54 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
36 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
47 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
30 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.
0
votes
2answers
92 views

How to store more than 5k items in List.How to deal List Throttling issue in JSOM Sharepoint Online?

I have a list in SharePoint online having more than 5000 items. How to deal it with JSOM or REST API.
0
votes
1answer
60 views

AllowMultipleValues in taxonomy field in CSOM Javascript

I am trying to create a taxonomy column within JSOM , I am nearly there but I have set the type to : var fieldSchema = `<Field Type="TaxonomyFieldTypeMulti" Name="...
1
vote
1answer
47 views

Adding the metadata to a taxonomy column in JSOM

I am struggling getting taxonomy into a metadata column using JSOM. I cannot find any great learning manual for JSOM. var fieldSchema = `<Field Type="TaxonomyFieldTypeMulti" ...
0
votes
1answer
35 views

How to add non list based OOTB web parts with JSOM Sharepoint 2013

I am attempting to add a Query String Filter Url Web Part to a page programmatically with JSOM and am hitting a dead end. I see how you can add a web part if you already have the XML like in this ...
1
vote
1answer
112 views

Are there any dependencies for PS.js (Project Server JSOM)?

Because I can't seem to do what I need to get done using the REST API, I am going to try to use the Project Server JSOM in an SPFx webpart. I found instructions on how to load the SharePoint JSOM ...
0
votes
1answer
191 views

How to retrieve the SP list items without using CAML Query?

I have a SharePoint list and I need to get all items from that list without using CAML Query in JSOM. How can I do this?
0
votes
1answer
177 views

Fill SharePoint list element field (people picker) with JavaScript

I want to add a list element via JavaScript which works (almost). After the help from a user here I got this function fillStandard() { console.log("Standard"); var posInvest = "Invest"; ...
0
votes
1answer
38 views

Adding list element via JavaScript gives error

Please note that I'm doing this for the first time. I want to add an element to a list via JavaScript. Therefore, I tried this: function fillStandard() { console.log("Standard"); var ...

1
2 3 4 5
18