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
1 answer
16 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 ...
Adam R. Turner's user avatar
0 votes
1 answer
277 views

spservices.js.Error:- Uncaught (in > promise) TypeError: Cannot read properties of undefined (reading > 'LookupList')

Inside our SPFx web part we have the following code inside the spservices.js code:- spservices.prototype.getLookupFieldOptions = function (siteUrl, listId, fieldInternalName) { return ...
John John's user avatar
0 votes
1 answer
324 views

Is it possible to dynamically add new choice field values/options if I check 'Allow fill in choice' to true (REST API)

Is it possible to dynamically add new choice field values/options while creating a new list item through rest API if I check 'Allow fill in choice' to true? Example The choice field 'ChoiceFieldName' ...
Jefin Mathew's user avatar
0 votes
1 answer
92 views

Show Site Admin information on Access Denied page SharePoint 2013

I'm looking to add custom message on Access Denied page in SharePoint 2013 and need to add Site Admin information as each and every site's having different site owner, so message should come up with ...
Abhishek Tiwari's user avatar
0 votes
1 answer
685 views

Function wait for a loop before returning value in javascript

My function return value of an array before pushing value into array. private async getPPickerid(ppvalue,AssignedToIdArr):Promise<any> { return new Promise<any>((resolve, reject) => { ...
abhishek23 Negi's user avatar
0 votes
1 answer
169 views

Trying to grab the current search query value from Search Box input using Javascript (SharePoint 2013)

I have a SP Web Part search box on a number of pages and, in order to create a link that load a page with that search box auto-populated with the existing search, I've been using JS. I've managed to ...
txchou's user avatar
  • 101
0 votes
1 answer
129 views

Adding Custom Description to FileLeafRef(Name) BuiltInField Error

I came across this post here and the OP said the solution had worked for them. Solution from the above post: function addOrUpdateDescriptionOfColumn(libraryName, columnName, description) { var ...
BeerusDev's user avatar
  • 113
0 votes
1 answer
71 views

How to establish a real time connection to a list item using SharePoint Rest API

On my SharePoint home page I have a notification element that is ajax'd from a list item from the same site collection. I would like the user to always (or as often as possible) see the latest ...
Sateesh's user avatar
0 votes
1 answer
101 views

Adding a new item in the SharePoint list with multiple fields

My objective is to add a new item in a SharePoint list (Form) using REST API. My current code is: function AddData() { var listName = "Form"; CreateListItemWithDetails(listName, ...
Keshav Sharma's user avatar
1 vote
1 answer
467 views

Remove user from site group using PnP-SP in JavaScript

I'm trying to find a way to remove a user from a group using PnP-SP. My code is as follows: this.$pnp.sp.web.siteGroups.getById(this.selectedGroup.Id).users .remove(user) ....
Webweaver1021's user avatar
0 votes
1 answer
222 views

Video Should not Play every time when page loads and page reloads in a SharePoint page

In SharePoint default page I add script editor web-part and in this added below script <video width="100%" autoplay="false" controls="true" style="width: 100%;&...
user3520155's user avatar
1 vote
1 answer
412 views

Where is the secret list of field types kept?

I was trying to update a property on an existing SharePoint site column using the REST API. I found some tutorials like this Stack exchange post or this blog. They both have a __metadata property for ...
Rothrock's user avatar
  • 2,930
0 votes
0 answers
88 views

Enter on input field causing Edit Page view to open

Hello I have a SharePoint SPFx react webapp that I've developed. On one of my components I'm using this Material Table found here: https://material-table.com/#/docs/features/search My code looks like ...
hisusu32's user avatar
1 vote
1 answer
382 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: ...
michelle's user avatar
0 votes
1 answer
547 views

Checking if a list item combination already exists, and returning an alert using PreSaveAction function

I'm creating a script that will override submit form functionality when the save button is clicked. The goal is to validate user input by checking if a combination of columns already exists within a ...
Chief Simz's user avatar
0 votes
1 answer
3k views

Get SharePoint URL using sp-pnp-js in SPFx

I have a SharePoint SPFx react webapp that I'm working on. I'm trying to get the SharePoint URL. For example: https://mysite.sharepoint.com/sites/sitename/SitePages/Home.aspx#/ So I want to get ...
hisusu32's user avatar
0 votes
0 answers
16 views

Setting document details when uploading to SharePoint Online

I need to be able to set certain column details when uploading documents to Sharepoint (mandatory fileds to be able to edit the files). async uploadFile(file) { let data = new FormData(); ...
Alex M's user avatar
  • 1
1 vote
1 answer
266 views

I'm trying to run a javascript script through the script editor in sharepoint online, but nothing happens

In the script editor I have this code to disable some buttons: <script> document.getElementById(id="Status_c15b34c3-ce7d-490a-b133-3f4de8801b76_$DropDownChoice_Aprovado").disabled = ...
Odelam Sá Dias de Souza's user avatar
1 vote
1 answer
12 views

Can I overload a URL to return multiple subfolders in a calculated column?

I have two images that are both located in my site assets folder and I want to show the two images based on when a source column returns "yes" or "no". I have a wrapped around a ...
Chief Simz's user avatar
0 votes
2 answers
92 views

https://graph.microsoft.com/v1.0/users returns a 403 Authorization_RequestDenied

I have an SPFX application deployed on SharePoint online that requires to get the users of a SharePoint site collection. To do that I used the PNP Graph library using the JavaScript command graph....
Hallemon's user avatar
0 votes
1 answer
196 views

Apply a Custom Filter for a List View

So I came across the following post on Filter a list view using URL parameters, which is sort of what I was looking for but not at all at the same time. I have a custom DataTable on a SharePoint Web ...
BeerusDev's user avatar
  • 113
0 votes
1 answer
681 views

Copy attachments from list item to another list item

Case definition: i have item with attachments in list and i want to copy attachments to another list's item using web-forms and rest api probably I tried to use GetByTitle('')/id/AttachmentFiles, but ...
nikolaysaveliev's user avatar
0 votes
0 answers
89 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 ...
Shreya's user avatar
  • 55
1 vote
1 answer
652 views

Cors Error when generating access token for SharePoint point online from a JavaScript application

Any help is much appreciated. I'm trying to save data from a html form to a list in SharePoint online. I'm using SharePoint REST API to add items to the list. Ajax call to generate access token is ...
user100006's user avatar
0 votes
2 answers
1k views

SharePoint Online: Open up HTML files in browser

Before when I used SharePoint 2013, opening HTML files would open up in the browser and my JavaScript code works. Recently, my organization switched to SharePoint Online and I noticed the HTML files ...
Paul Vu's user avatar
  • 111
0 votes
2 answers
822 views

Javascript in SharePoint Online not working

I use the Modern Script Web Part to inject JavaScript into my site. I want to modify div elements by className with JavaScript. The script is running on my local PC but when I try to run it in ...
Christoph's user avatar
0 votes
2 answers
651 views

Update Sharepoint List Item with Javascript Client Side Object Model

For the past days I've been trying, with no success, to establish a connection to a sharepoint list (https://mywebsite.com/sites/concasbkcu/Lists/list_teste/AllItems.aspx) and update its items with ...
Dessiog's user avatar
0 votes
1 answer
128 views

Trying to upload document in "Attachment" column of SharePoint list

I am trying to upload document in "Attachment" column of SharePoint list. I am able to upload the document but not view the document. The SharePoint list is given below image:- When I am ...
Shreya's user avatar
  • 55
1 vote
1 answer
56 views

Issues with links with url parameters in Sharepoint modern UI( I have to click link twice)

I'm using the modern script editor. What i'm experiencing is if i use the below <div><a href="/sites/Mysite/SitePages/People.aspx">People</a></div> it works But when ...
naijacoder's user avatar
  • 4,174
0 votes
2 answers
80 views

AJAX Data From SharePoint List Not Carrying Over to Next Function

I have created fiddle with mock sample data that is formatted the same way as the AJAX response data. When I try to implement my script into a SharePoint script editor and debug it, it tells me that ...
BeerusDev's user avatar
  • 113
0 votes
1 answer
288 views

jQuery Datatable not loading - SPFX Application Customizer

I'm trying to migrate jQuery Datatable from On Prem 2013 to online, I'm gonna create SPFX application extension, where I insert the scripts in order, still datatable is undefined. $.fn.dataTable is ...
Arun's user avatar
  • 113
0 votes
1 answer
238 views

.JS file opening blank in browser

javascript(.js) file opening blank in the browser, when changing name it's showing all content. ex - regular-method.js -> opens blank regular-method1.js - opens with all it's content
AJ.'s user avatar
  • 11
0 votes
1 answer
78 views

How to subtract a year from sharepoint date using javascript

I have a date column (Date Time only) Display format for the column is standard I tried the below var te = new Date(ctx.CurrentItem.Due_x0020_Date); I get this output : Fri Mar 12 2021 00:00:00 GMT+...
naijacoder's user avatar
  • 4,174
0 votes
1 answer
338 views

Identify if guest sharing is enabled in SPFx

I tried using context.pageContext.legacyPageContext.guestsEnabled, but it returns false when external sharing on the site is set to "Existing guests only" and works fine for "New and ...
Mohammad Rayan's user avatar
1 vote
1 answer
58 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&...
bensonwong's user avatar
0 votes
1 answer
145 views

How to join the multi row value in single row of SharePoint list

I would like to submit the multiple line item value in single row of SharePoint list. The result of the actual submitted value in SharePoint list is shown below image:- If the column value is equal ...
Shreya's user avatar
  • 55
1 vote
1 answer
448 views

SharePoint Framework not working with script tags

I'm trying to create a web part within SharePoint framework which includes <script> tags however they do not run while in SharePoint, see example code below: public render(): void { this....
Reuben's user avatar
  • 11
2 votes
1 answer
588 views

I am trying to get the choice type field value in select tag from SharePoint list

I am trying to get the choice field value in select tag from SharePoint list. Here, the code is given below: function GetphysicalVertual() { var defPG = $.Deferred(); var inputElement; $....
Shreya's user avatar
  • 55
0 votes
0 answers
67 views

Modal JS not working in Chrome for Calendar CEWP

On a site page, I have a Calendar CEWP and the following JS in a script editor. The calendar events pop up in a modal in IE but they do not in Chrome. Can anyone identify why it is not working in ...
seaandtea's user avatar
0 votes
1 answer
166 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 ...
retro's user avatar
  • 11
1 vote
1 answer
694 views

How to add users to a list by REST API before they are added to a list manually

I'm using SharePoint Online and SharePoint REST API v1. I realize that after a user is added to people column of a list manually, I can get user ID and add this user to a column by the API. But I need ...
decoy's user avatar
  • 13
0 votes
1 answer
699 views

How to get list of folders data from SharePoint List using Javascript?

Can anyone please help me with that? Suppose my list name is: Country in which I created 5 folders with different country names, then inside that folder I created their state names. So scenario is ...
Sayyed Amir Hussain's user avatar
1 vote
1 answer
556 views

Try to download multiple files from SharePoint library on Button click

I am trying to download multiple files from SharePoint library by clicking on Download All button. The image is given below: How can I download all files from SharePoint library on a single click on ...
Shreya's user avatar
  • 55
0 votes
0 answers
104 views

Color Coded Columns in SharePoint 2013 classic view

I am trying to create a custom list that has custom color coding that is dependent on what the choice field values. I have tried to save my JavaScript file to my site assets and master pages of the ...
Jade's user avatar
  • 1
0 votes
1 answer
231 views

SharePoint Online - Search API call using filters

I am trying to call SharePoint search API through JavaScript but cannot get it working. I need to get all documents in a SharePoint site where Title='Test'. I am using SharePoint online. Can someone ...
sseth2011's user avatar
1 vote
1 answer
126 views

Indexed column throws threshold error while filtering based on range

We have a list with over 1M items. The end goal is to filter the column InvDate based on date range. The InvDate is an indexed single line of text column , However it throws the List View Threshold ...
Vivek's user avatar
  • 37
0 votes
2 answers
354 views

Form Digest expires while copying 1M List Items

We are copying more than 1M+ list items with 27 columns from List A to B. Got to the point where all the items are fetched from List A. The code throws form digest error after copying around 2K Items. ...
Vivek's user avatar
  • 37
1 vote
0 answers
43 views

Edit and Delete options for each sharepoint list item using query Datatables?

How to use jquery Datatables to add - Edit and Delete options for each sharepoint list item. Please help me with an example.
Amar Singh's user avatar
1 vote
1 answer
158 views

Pass whatever is at current page ID to next page using a url

I want to pass my current ID dynamically when I click a hyperlink button from my ../dispform.aspx?ID=248 page to a second page .../dispformManager.aspx?ID=@ID Does anyone have the correct code for ...
user95039's user avatar
1 vote
1 answer
1k views

Is there any way to pass html content while triggering mailto: option?

While triggering mailto: link, is there any way to pass some predefined HTML to the opening mail?
JishinK's user avatar
  • 175