Questions tagged [jsom]
Use the JSOM to retrieve, update, and manage data in SharePoint.
872
questions
1
vote
1
answer
28
views
How to set data in custom Web Property SharePoint online?
Could you help me please, how can I set a value to custom web property in SharePoint and then get this property later?
Now, I only can get all default properties using [web url]/_api/web.
0
votes
0
answers
50
views
How to copy a WebPart to another publishing page in SharePoint 2019 On-Prem (Classic) using JSOM
We've got a scenario where we have Publishing pages with a set of master fields and on save it creates or updates a series of related pages with data from its various columns. This works fine so far, ...
0
votes
1
answer
98
views
How to update managed metadata column with multiple values using JSOM
I'm using JSOM to update a managed metadata column (in SharePoint 2016) using term GUID like this:
...
var oListItem = collListItem.itemAt(i)
oListItem.set_item('SPSBaranID', theTermGUID)
oListItem....
0
votes
1
answer
73
views
How to save bulk records in SharePoint List using JSOM
I have weird issue saving multiple records to SharePoint List via JSOM using below code where sometimes most of the records were saved and sometimes were not.
Is there any best practice to save ...
0
votes
0
answers
170
views
In JavaScript, how do I create a SharePoint 2019 (on Premise) publishing page?
I am trying to find a way to create (and later update) a SharePoint 2019 publishing page via JavaScript. There seems to be a lack of documentation specifically directed at SP 2019, but plenty of SP ...
1
vote
1
answer
107
views
Upload Attachments on SP CUSTOM list
I'm using HTML to create a custom list with bootstrap and then JSOM to manipulate and display the list on a SP custom list.
I am looking to add attachments and I can't figure it out.
Can anyone help?
...
0
votes
2
answers
224
views
update list item with presaveaction function
can anyone help me out with the code below. I'm attempting to update a list item on save. I believe I would do this with the presaveaction function. Can you please tell me where I'm going wrong. I'...
0
votes
0
answers
41
views
function presave action to update item
I'm attempting to update a list item upon clicking save on my newform. I think I'm close, but perhaps not as I'm really new to this. My wheels have been spinning for a few days.
I am attempting to ...
0
votes
1
answer
380
views
SharePoint content type based metadata column is not updating in Document library
I have created a site column that is a metadata type column. From that site column, I have created a content type that content type is assigned to the Document library. Now I have tried to update that ...
0
votes
1
answer
2k
views
Upload Large File to SP Online in Chunks using Rest API - FinishUpload fails
I was trying to upload the a larger file (500mb) to SharePoint Online document library. I followed the way to upload the file in Chunks with the Article:
Programmatically Uploading Large Files In ...
0
votes
1
answer
237
views
Changing title text in SharePoint top navigation bar using TypeScript/JSOM
I'm trying to change the title of the first item in the top navigation bar in a SharePoint 2019 modern site. The code is run in a TypeScript web part.
My code below runs fine and no errors are ...
0
votes
1
answer
51
views
Using JSOM outside sharepoint
I have a big application that uses the SP.ClientContext (JSOM).
I need to deploy it to a static web app on Azure.
How can I obtain the variable (or something similar)? I would like to avoid switching ...
0
votes
1
answer
77
views
Deploying an application that uses SP.js
I have a big application that uses the SP.ClientContext (JSOM).
I need to deploy it to one of these 2 options:
SharePoint Web Part (https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-...
0
votes
1
answer
22
views
Saving/Updating a Wikifield column for Wiki Library using JSOM
I've written some code in an attempt to keep a Content Editor Web Part in sync with a Wiki Pages Library.
This code executes and states that it's completed successfully without error. Checking the ...
0
votes
1
answer
72
views
CAML multiple AND Conditions
The CAML query below didn't work for me. Any help?
$viewQuery = "<Where><And><Eq><FieldRef Name='PP'/><Value Type='Integer'><UserID Type='Integer'/></Value&...
0
votes
1
answer
235
views
SharePoint Online CSOM/JSOM Get all root folders from Document Library and its all ItemChildCount (items including inside respective subfolders)
We have document library having records more than 25000 items including many folders.
Using CSOM/JSOM need to get all root folders from Document Library (having more than 5000 items) and its all ...
0
votes
1
answer
42
views
How to connect two SharePoint on-premises installations inside the same domain using JSOM?
I have two SharePoint installations in the same domain.
Example:
Installation 1: subdomain.domain.com/sites/mySite
Installation 2: subdomain2.domain.com/sites/mySite2
Also, they share the users.
I ...
1
vote
1
answer
548
views
Get Current Folder URL using Client Context for JavaScript
I am currently trying to retrieve the current URL of a document library using JavaScript.
My ultimate goal is to un-hide a web part when the user clicks a specific folder.
Right now,
My code so far:
...
0
votes
0
answers
30
views
Change the selected view of calendar web part using REST or JSOM
I have a requirement where employees from different departments will book for work from office, but only 30% employees can book for a day.
Here I am using a content editor and calendar web part on a ...
0
votes
0
answers
96
views
Trying to upload the date type from excel to SharePoint list column
I am trying to upload date column value in SharePoint list column of "date and time" type.
The below image of excel data:
The "Date of Commissioning" value upload in SharePoint ...
1
vote
1
answer
92
views
How can I get ID when I insert new items to list?
I'm currently using JSOM to insert new items to list.
var clientContext = new SP.ClientContext();
var oWeb = clientContext.get_web();
var oList = oWeb.get_lists().getByTitle("request&...
0
votes
1
answer
566
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
1
answer
2k
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
1
answer
118
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
2
answers
62
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
0
answers
90
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
1
answer
44
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
1
answer
204
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
0
answers
35
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
0
answers
152
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
1
answer
51
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.
1
vote
2
answers
121
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
1
answer
89
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
3
answers
638
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
1
answer
48
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
1
answer
64
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
1
answer
34
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
"...
1
vote
1
answer
64
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
2
answers
94
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
1
answer
52
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
1
answer
379
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
1
answer
34
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
2
answers
1k
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
1
answer
96
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
2
answers
4k
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
1
answer
168
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
2
answers
138
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
1
answer
67
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
2
answers
24
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
1
answer
663
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 ...