Questions tagged [javascript]
Javascript is a dynamic computer programming language, most commonly used as part of web browsers, whose implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed.
5,368 questions
0
votes
1
answer
50
views
"getGlobalClassNames is not a function" issue appears in July 21 patch
We are currently having an issue with our SharePoint 2019 install after applying the July 21, 2025 updates (KB5002753, KB5002754). The version prior to the upgrade was 16.0.10417.20010 (May 2025; ...
0
votes
0
answers
22
views
Can't read any sharepoint variables from a browser extension
I wanted to read SP variables for a browser extension but I failed.
My code works fine when run directly in the dev console, but it failed when embedded in a browser extension.
Variables defined in ...
0
votes
0
answers
20
views
got TypeError: "x" is not a function with read permission to code directory, no issue with Edit permission
I use JavaScript code to make rest api call to load drop down fields in a form, with list items from SharePoint list.
When the user has read permission to code directory, he got TypeError: "x&...
0
votes
1
answer
213
views
How to hide the Recycling bin button from the Team site navigation?
How to hide the Recycling bin button from the Team site navigation, but show it only to one SP group?
Need to do this without publishing features. Is it possible to do this with Application ...
0
votes
0
answers
59
views
MS Project Server - how to insert a new child entry into an existing Enterprise Custom Lookup Table using the REST API (or JSOM)?
Through much trial and error, I was able to figure out how to create custom Enterprise Lookup Tables, and populate them with entries, using the Project Server REST API.
I now need to be able to add ...
0
votes
1
answer
41
views
Archive List Items Annually
I have a list that I need to archive items from on the first of the year. My company is running on SharePoint 2019, but still uses SharePoint Designer 2013 and 2010 workflows. I am not a developer, ...
0
votes
0
answers
37
views
Render HTML in calculated column
After Microsoft stopped allowing HTML to render in calculated columns, I applied the below script to my web part page. However, it doesn't work if I page over in the view (ie. I go from 1-30, 31-60). ...
0
votes
1
answer
35
views
SharePoint 2013 how to pass URL with parameters for refreshing page after close a page
I has got this code. I want to pass a url with parameters to refresh the page after the popup close. Could You please tell me how to do this ?
If I pass this code it refresh me a page but without my ...
0
votes
1
answer
213
views
Open another sharepoint page onclick on Modal PopUp
I would like to open another page by click on the button from Landing page, I have followed the below suggestion. Looks like it only works on 2013 but not on sharepoint online.
I am adding this script ...
0
votes
1
answer
39
views
Load Video on SharePoint Online Immediately
We are facing an issue loading the video on the custom landing page (using AngularJS + HTML) on SharePoint online. It takes 2-3 seconds to buffer the video after loading the page, then it's playing, ...
1
vote
1
answer
154
views
Only get part of the SharePoint list with JavaScript Fetch
I have a problem with getting all SP list item (257 currently) with fetch.
I have the following code:
var tasks = new Request(
webUrl + "/_api/web/lists/GetByTitle('" + listName + &...
0
votes
0
answers
63
views
How to show column based on the certain radio button value selected
our company just upgraded our Classic SharePoint to 2016 and currently I'm working on the SharePoint workflow for approval. I have 2 questions?
1.) Post upgrade, I noticed all of the scripts that ...
0
votes
1
answer
110
views
Typescript custom action deploying banners with SharePoint 2019 list item data
I have a HelloWorldApplication which is in a development environment using gulp serve as the deployment.
I am able to deploy the solution to a page, which renders banners on the top and bottom of the ...
0
votes
1
answer
285
views
Host a static JS-enabled webpage behind SharePoint credentials
Looking for a simple solution. My clients want a static JS-enabled webpage deployed in such a way that users need to enter their SharePoint credentials in order to see it. As a result, we cannot put ...
0
votes
0
answers
40
views
POST drop down custom column selected value into SharePoint list
I have build a custom drop down field using HTML, the values in dropdown choice are coming from SharePoint list using GET API. I also added button with name "AddItem" in front of dropdown so ...
0
votes
2
answers
675
views
Running a function within a .ts file that is triggered by a button inside of a separate .tsx file
My issue is that there is an html button that exists inside of my. tsx file, and I cannot get a function to fire When that button is clicked. The tricky part is that I need for a function that exists ...
0
votes
1
answer
38
views
Retrieved value from field does not show correctly
I have a question regarding encoding I suppose.
So when a user inputs in a form some value, like this for example:
(bla {{blabla"bla bla bla" "some more bla bla bla" "bla&...
0
votes
1
answer
245
views
Script Editor , working fine on my end but everyone else can't see changes
I have a SharePoint site with 3 webpart pages + 1 wiki page ( HOME ) and client asked me to remove "Recycle Bin" and "Page Title" for every page.
I did this by using a script ...
2
votes
1
answer
177
views
SharePoint Online Filter By URL
I am working with the SharePoint API and trying to filter search results based on specific URLs.
Currently, I have the following search query:
http://www.test.com/_api/search/query?querytext=%27Hello%...
0
votes
0
answers
169
views
Changing SharePoint Calendar Event Form - Visual Customization and Conditional Inputs
I need help with customizing the SharePoint calendar event creation form. Currently, when I create an event, it opens a default form.
Here is a picture of the default form:
And here's what I'm trying ...
0
votes
1
answer
207
views
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory - SPFX Solutionn Terminal error
When I try to run gulp serve command in the terminal, it works sometimes, but sometimes it throws some error like this, which I mentioned in the image below.
And it takes more time to run, so can ...
0
votes
0
answers
104
views
JavaScript\moment.js function won't change date
I have date fields that I need to run calculations on. Its a 3 step process.
Run date through function to compare against holiday list, if date matches a date listed in holiday list, push forward 1 ...
1
vote
1
answer
53
views
Filtering SP List using created
I want to filter the SP list using created date so that list items created in last 8 days get displayed.
I am using:
private getCarouselListContent = () => {
try {
let requestUrl = `${...
1
vote
3
answers
208
views
Using SharePoint 2016. Trying to write JavaScript to change row color based on today's date and "SuspenseDate" in list. Help?
I would deeply appreciate any help. I have been staring at this code for days. I am trying to add a Script Editor web part above a list, and make the rows in the list change color according to how ...
0
votes
1
answer
1k
views
read docx file with javascript in sharepoint
i'm trying to read docx file
(function(){
var serverRelativeUrlOfMyFile = "/sites/sitecollection/mysite/assets/file.docx";
var req = new XMLHttpRequest();
req.onreadystatechange=handler;
req....
0
votes
1
answer
258
views
I need to open SharePoint link in client application in edit mode. Can you please help?
I need to open SharePoint link in client application in edit mode. Below given is the code I am using. It is not working. I don't know where am doing mistakes.
<!DOCTYPE html>
<html>
<...
1
vote
1
answer
91
views
How to count SharePoint list from managed metadata column in SharePoint online?
I have one field manage metadata which name is department and its has 3 value HR, Admin and account so I want to filter out Admin data and display count of results. I am using SharePoint online.
0
votes
0
answers
855
views
Cannot Embed HTML with JavaScript
I am trying to embed a local HTML file with inline JS on my SharePoint page. The HTML shows up but the JavaScript is blocked. The HTML file embeds, but the JavaScript does not run. Here is the error I ...
1
vote
1
answer
159
views
SharePoint Online Display All Options in a Choice Field In A Custom Page
Is there a way to fetch all the Choice Options of a Choice Field created in a SharePoint Online List and to display in a custom SharePoint Page(Inside Pages Library/Site Pages)?(Without the help of ...
0
votes
0
answers
52
views
Setting input value in modern experience with javascript
I'm trying to automate the adding of a list entry in sharepoint online lists with modern UI and plain JS.
Setting the value works fine using:
// Stolen from StackOverflow ;)
const inputTypes = [
...
0
votes
1
answer
395
views
LivePersona control doesn't work
I did everything according to the pnp documentation (https://pnp.github.io/sp-dev-fx-controls-react/controls/LivePersona/#livepersona-control), but the LivePersona control does not work for me.
Photo ...
0
votes
1
answer
527
views
How to add header to graph pnpjs
I tried to get all users from Azure AD with Hire date > 2012-12-31T23:59:59.
return graph.users
.select("givenName", "surname", "employeeHireDate", "id"...
1
vote
2
answers
119
views
Anniversaries webpart using Azure AD
I've a custom webpart Anniversaries, which get data from list.
This is my service to get data from list:
public get(listName: string, startDate: Date, AnniversariesNumberOfItemsToDisplay: number): ...
1
vote
1
answer
271
views
Trying to encode Special keywords from Value in react
I am trying to filter the special keyword value from SharePoint list. Filter query doesn't work when filter the value.
I am applying the encodeURIComponent solution for encode the special keyword. But ...
0
votes
1
answer
299
views
web part new version not always loading
I ran into a problem, after installing a new version of the webpart with changes, it does not always load on the site. Through time the old and new are loaded.
I incremented the package versions.
A ...
0
votes
1
answer
298
views
How to upload Large files using node.js and spsave module
I have implemented multiple file uploads using spsave. But whenever i try to upload larger file(5mb+) files are not getting uploaded.
const apiRequest = spsave(coreOptions, creds, fileOptions);
...
0
votes
1
answer
501
views
Searching for specific text in html code of SharePoint Online page
On a SharePoint online modern site, I need a JS variable to search for a specific string of text in the code of the page (this variable is for Google Tag Manager). I have tried:
function() {
var ...
1
vote
1
answer
2k
views
A type named ... could not be resolved by the model - but code is fine
I am trying to add an item to a SharePoint list synchronously. but I get the error
"A type named 'SP.Data.QAReadAndSignListItem' could not be resolved by the model. When a model is available, ...
0
votes
0
answers
53
views
The name of the Site Collection does not appear in the service query
Could you help me please, I try to understand, why the site collection doesn't appear in my service query?
This way, I get an error:
This is my service to get data from list:
export class ...
1
vote
1
answer
111
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
1
answer
1k
views
how to get data from responseJSON
I am trying below code but always get undefined in console for console.log(responseJSON.Title);
this.props.context.spHttpClient.get(`https://someazuresite.azurewebsites.net/api`,
SPHttpClient....
1
vote
1
answer
780
views
How to create several files with addUsingPath in a batch?
I'm trying to use pnp/js to create a batched web and add new files to a folder with addUsingPath with this code:
const sp: SPFI = spfi().using(SPBrowser({ baseUrl: options.baseUrl }))
const [...
0
votes
3
answers
530
views
How to build a CAML query from a string of data in JavaScript?
I have a string 'listOfUsers' which is in the format user1;user2;user3;user4;user5;user6;
This string could have any number of users.
I would like to build a CAML query which will find all those users....
0
votes
0
answers
303
views
Get users properties from displayname of user using javascript
I need to get user properties such as email, id, account name, department, and job title using JavaScript. I can successfully pull someone's display name from a people picker field, however, trying to ...
0
votes
1
answer
75
views
How to use JavaScript to conditionally format a grouped view of a SP13 list
I have found examples that allow for highlighting a row based on date, I need to also highlight the 2 group tabs above that row
example
Group(highlight red if any row in group meets condition)
...
0
votes
1
answer
107
views
How can I active QuickEdit with Javascript?
we're customizing a lot of customers sharepoint sites and we need to turn on/off QuickEdit multiple times, I want to create a Bookmarklet to achieve this, but the setting can't be found.
I've tried by ...
0
votes
1
answer
221
views
Disable dropdown selection in newform aspx
I have below code which hide the dropdown but I want to disable it or greyout the selection
<script src="https://code.jquery.com/jquery-3.3.1.js" type="text/javascript"></...
0
votes
1
answer
273
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....
1
vote
1
answer
2k
views
Javascript not working in SharePoint Online
I use the SharePoint Online Modern Experience.
I am trying to run Javascript in my sharepoint online page but it will not run. It runs on my computer however and correctly displays the resultant page.
...
0
votes
1
answer
144
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 ...