Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

NewPage.aspx redirects to recycle bin on SavePage - suspected document library error

When I create a new page in SharePoint and save the page it automatically gets checked out and is moved to the recycle bin with the error: {"odata.error":{"code":"-1, ...
Lina Arras's user avatar
1 vote
1 answer
35 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 + &...
Lokids's user avatar
  • 13
0 votes
0 answers
24 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 ...
Sabry's user avatar
  • 1
0 votes
1 answer
52 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 ...
Alexander Lange's user avatar
0 votes
0 answers
19 views

target="_blank" attribute is stripped out of <area> elements on SPO page

SharePoint Online is stripping the target="_blank" attribute out of my <area> elements when I add them to a page by editing the markup directly. This is the relevant code I am ...
TylerH's user avatar
  • 254
0 votes
0 answers
17 views

SharePoint Classic - JavaScript issue

This is my JavaScript file that works, but only does not work in SharePoint. May I please have assistance on why it doesnt? function initializeCustomScript() { // Wait for the DOM to fully load ...
justin's user avatar
  • 1
0 votes
0 answers
7 views

Lookup Multi control - is there a client side JS API like SPClientPeoplePicker?

I have a Lookup field for which I am allowing multiple values, however I want the list of available options on the left side of the multi-select to be filtered by another control on the form. I can ...
Dylan Cristy's user avatar
  • 12.8k
0 votes
1 answer
26 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 ...
Wynne's user avatar
  • 101
0 votes
0 answers
21 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 ...
Sourav's user avatar
  • 1
0 votes
2 answers
85 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 ...
Java Uzumaki's user avatar
0 votes
1 answer
20 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&...
Shkipper's user avatar
  • 2,105
0 votes
1 answer
72 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 ...
gabriele gardelli's user avatar
2 votes
1 answer
65 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%...
Jedi's user avatar
  • 23
0 votes
0 answers
18 views

Display Department and Department SP Site URL in SharePoint Site

Im new to SharePoint but ive trying to create a new intranet homepage, where under a section i can pull information about the user who is currently viewing the page and then display the team SP site ...
madman's user avatar
  • 1
0 votes
0 answers
15 views

UpdateFormDigest not always working [duplicate]

We have a SharePoint Online site with a list (called PEP) where the EditForm is in classic SharePoint and customised with a WebPart that loads an HTML file witch itself loads some JavaScript code. ...
Mathieu's user avatar
0 votes
0 answers
43 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 ...
Joaquin Fernandez's user avatar
0 votes
1 answer
142 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 ...
Ashish Prajapati's user avatar
0 votes
0 answers
47 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 ...
Ghoztrider's user avatar
1 vote
1 answer
12 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 = `${...
KIRTI JAISWAL's user avatar
0 votes
0 answers
88 views

Download File Using URL using NodeJS

So I implemented google drive url download feature recently and It starts downloading the publicly shared file directly without any authentication. When I tried the same with SharePoint, I got 403 ...
Maaz's user avatar
  • 1
0 votes
0 answers
129 views

Creating a SharePoint signed URL

The below is the SharePoint URL to access the required document: https://companyName.sharepoint.com/_api/web/GetFileByRelativeUrl(%27/companyName%20ABC/contact/fileName.jpg%27)/$value But pasting the ...
Vettel Hamilton's user avatar
0 votes
0 answers
41 views

401 (Unauthorized) When calling Sharepoint Query

I am currently getting this error 401 when I try to call my Sharepoint Endpoint. It occurred after I added the following Access-Control-Allow-Origin into the IIS header. I am unsure if this is an ...
Tim3's user avatar
  • 1
1 vote
3 answers
65 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 ...
OKSharePoint1234567's user avatar
0 votes
0 answers
41 views

Is there a way to trigger a Document Set version capture from JavaScript? Maybe through the REST API?

According to this article, the only way to create a Document Set version is to do it manually by clicking on "Capture Version". I know that's not entirely true because DocumentSet....
Dylan Cristy's user avatar
  • 12.8k
0 votes
1 answer
945 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....
Ann's user avatar
  • 61
0 votes
1 answer
86 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> <...
Pavithra's user avatar
1 vote
1 answer
61 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.
vinia shah's user avatar
0 votes
0 answers
551 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 ...
DarthCaniac's user avatar
1 vote
1 answer
72 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 ...
Aparna Sunil's user avatar
0 votes
0 answers
28 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 = [ ...
MsListsAutomator's user avatar
0 votes
1 answer
258 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 ...
Propool's user avatar
  • 37
0 votes
1 answer
321 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"...
Propool's user avatar
  • 37
1 vote
2 answers
61 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): ...
Propool's user avatar
  • 37
1 vote
1 answer
184 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 ...
Shreya's user avatar
  • 55
0 votes
1 answer
211 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 ...
Propool's user avatar
  • 37
0 votes
1 answer
226 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); ...
Akhil Mekkatt's user avatar
0 votes
1 answer
289 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 ...
dominique's user avatar
1 vote
1 answer
940 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, ...
Naama Frank's user avatar
0 votes
0 answers
35 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 ...
Propool's user avatar
  • 37
1 vote
1 answer
53 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.
Propool's user avatar
  • 37
0 votes
1 answer
830 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....
kumar's user avatar
  • 139
1 vote
1 answer
501 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 [...
Angelo Selvini's user avatar
0 votes
3 answers
376 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....
Pete Whelan's user avatar
0 votes
0 answers
222 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 ...
Ghoztrider's user avatar
0 votes
1 answer
25 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) ...
James's user avatar
  • 1
0 votes
1 answer
68 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 ...
andrey's user avatar
  • 1
0 votes
1 answer
148 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"></...
kumar's user avatar
  • 139
0 votes
1 answer
180 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....
KDM's user avatar
  • 1
1 vote
1 answer
1k 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. ...
John Doe's user avatar
0 votes
1 answer
97 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 ...
BizApps's user avatar
  • 733

1
2 3 4 5
108