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
6 views

Help Opening Sharepoint Online File in Desktop App

I got a pnpjs listview and i need that in a context menu i create i be able to click a link and replicate the behavior of Sharepoint online "Open In App" context menu. i this is the method i ...
rread's user avatar
  • 1
0 votes
0 answers
12 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
26 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
21 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
9 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
30 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
43 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
30 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
44 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
25 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.6k
0 votes
1 answer
394 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
  • 51
0 votes
0 answers
75 views

I need to open a sharepoint document in new tab in browser directly from the sharepoint site we created for this project using jquery calls and html

$(document).ready(function() { // Attach a click event handler to the document link $('.document-link').click(function(event) { event.preventDefault(); // Prevent the default link behavior ...
pavithra ramaswamy's user avatar
0 votes
0 answers
80 views

Hide show text field based on multiple checkboxes - Problem getting ticked checkbox value

I'm trying to show/hide fields on a SP2016 classic on-Prem Form. I have 4 checkbox (ChBx1 to 4) hiding/showing their own text field (ChBx Text), but there's one text field (ChBx Text All) common to ...
AnthonyS's user avatar
0 votes
1 answer
26 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
0 votes
0 answers
26 views

How to get manage metadata fields and its value in SharePoint online?

I have multiple lists and it has multiple columns also. So, I want to get all columns list and its value. Example:
vinia shah's user avatar
1 vote
1 answer
45 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
264 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
0 votes
0 answers
36 views

Spfx NoJS framework question with using plugin

I'm working on a spfx webpart and using NoJS for it. The webpart is an imageslider with carousel. I'm going to be using the plugin here The plugin is FancyApps The issue is how to bind the plugin ...
naijacoder's user avatar
  • 4,232
0 votes
0 answers
16 views

Trying to ecapsulate CRUD functions for REST API in a custom class, but I keep getting a 403 error even with permissions verified and request header

As my title says, I am building a custom class to easily read and update items from a sharepoint list to an ASPX page. Reading is fine, it shows up as expected. But when I try to update a specific ...
Fennario's user avatar
1 vote
1 answer
37 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
16 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
0 answers
25 views

Remove javascript when user navigates to a different subsite

I have an app that loads in JavaScript and CSS files when it initializes; when the user navigates to a different subsite that has different files to load in, the app triggers again and loads in the ...
karma n effect's user avatar
0 votes
1 answer
169 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
177 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
31 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
0 votes
0 answers
14 views

How to highlight multiselect field in SharePoint 2019 using javascript

Since migrating to SP 2019 I can no longer use calculated fields to create highlighted fields and have now turned to JavaScript to accomplish the same thing. <style> .greenSymbol { height: ...
James's user avatar
  • 1
1 vote
1 answer
112 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
139 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
194 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
146 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
508 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
33 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
0 votes
0 answers
14 views

Changing the name of a document by adding ID to it in js

I hope you can help me. When uploading a document to a document library, I try to change the name and pass values I selected before. Say the current name + the ID of the document. However, I am not ...
Hasenstern's user avatar
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.
Propool's user avatar
  • 37
0 votes
0 answers
29 views

SharePoint Online JavaScript executequeryasync callback not fired

Can someone help me? I tried to write an add-in. The add-in contains 2 pages (default and init), a JS module and add a button to the documentlist part. When user selects a folder and clicks the button,...
LucVallot's user avatar
0 votes
1 answer
507 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
309 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
0 answers
96 views

JavaScript dropdown select redirect and localStorage clear

I have spfx extension with dropdown selection on the top placeholder which it navigates between sites so when navigating between the sites I would like clear localStorage which it clears while ...
striker92's user avatar
  • 101
0 votes
2 answers
249 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
165 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
21 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
0 answers
73 views

How to copy select fields from existing list item to new list item using JavaScript Object Model in SP

I want to copy one item from a list (source) with some of its fields to an identical list (i.e. has the same fields) on another SharePoint site (destination). I've got this far with the code that ...
Laetitia's user avatar
0 votes
1 answer
41 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
96 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
100 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
602 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
74 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
  • 723
1 vote
2 answers
407 views

Custom Page in SharePoint Online

I would like create a custom page in the SPO using SPA with HTML,CSS and JS. I was not able to find a way to start with I want complete page or Full Page. I want create like webpage with responsive to ...
striker92's user avatar
  • 101
0 votes
0 answers
55 views

SharePoint: UserProfileLookup(UserName,"PictureURL") to link to another field to display the user profile picture

I am developing a search page for staff biographies in my company. I am using a formula "UserProfileLookup(UserName,"PictureURL") in a calculated field in SharePoint. I got the User ...
Srivatsan's user avatar
0 votes
0 answers
61 views

Color code rows of SharePoint 2019 list with multiple pages in classic view

I have a long status list in SharePoint 2019 that has the following CSS for color coding rows: How do I get this to work on all the multiple pages vs just the first page of the list. Can the code be ...
user95039's user avatar

1
2 3 4 5
108