Questions tagged [jsom]
Use the JSOM to retrieve, update, and manage data in SharePoint.
869
questions
0
votes
0
answers
20
views
How to get default MS Project fields / field names in MS Project Server using client API?
In MS Project Server, if you go into PWA Settings and then "Manage Views", and go into a view as if to edit it, you can see a list of all of the default / built-in Project fields:
Is there ...
0
votes
1
answer
50
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
28
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
15
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
35
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
0
answers
16
views
Get groups and permission level assigned to each item
I'm attempting to write a script that will get me all the permissions assigned to an item. Ideally I would need the group name and then their permission level (read, contribute, etc.). I got the group ...
0
votes
1
answer
7
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
23
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
0
answers
50
views
Invite external users to office 365 programmatically using "jsom"
I need to invite external users on office 365 using JSOM or REST API then as per requirements I need to get newly added user and will add that user into a SharePoint subsite's permission group.
I can ...
0
votes
0
answers
39
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
21
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
53
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
20
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
20
views
Find Sharepoint lookup field source URL in different web using javaScript
I have a need to get information about a lookup column in a SharePoint list. The lookup column is a site column that lives in a top level site collection (there could be one ore more of these lookup ...
0
votes
0
answers
27
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
26
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
48
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
0
answers
25
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
1
answer
558
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
0
answers
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
1
answer
116
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
39
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
47
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
21
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
75
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
19
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
62
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
34
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
62
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
25
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
205
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
27
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
45
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
25
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
44
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
54
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
24
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
198
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
21
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
860
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
68
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
1k
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
96
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
93
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
50
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
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
1
answer
289
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
2
answers
282
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
1
answer
30
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
2
answers
42
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 ...