Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
1answer
47 views

SPFx calls blocked by CORS policy

I'v been trying to access various apis through SPFx and I am constantly seeing this issue. I do not know how to fix this can anyone assist or explain what I am doing wrong or missing? This works ...
0
votes
1answer
35 views

SharePoint app not writing to list (Javascript)

I am trying to create an app which posts information to a SharePoint List. function createListItem() { try { var userName = document.getElementById("name").value; var ...
0
votes
0answers
24 views

Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request

I'm trying to make a call to Slack by building the request inside SPFx webpart. I get this error: Access to fetch at 'https://slack.com/api/users.list/?token=xoxp-...
4
votes
2answers
217 views

Create modern team site in SPFx

I found some articles which are explaining creating modern sites with CSOM. But I am not able to find in JavaScript to use in SPFx. Creating modern sites is supported with SPFx? Any PnP extension ...
2
votes
0answers
17 views

Update a library field when uploading a file using javascript

I am using a spfx webpart to upload a file and modified a column value associated tothat file. The code below works and stop working without any reason and i can modify only the title field with it. I ...
1
vote
0answers
22 views

Request Failed. Specified Argument was out of Range, Parameter Name: Index undefined

I have this custom action in sharepoint where the page will be redirected to another url but the components of the URL are dependent on a fielvalue in its parent folder, Request Failed. Specified ...
0
votes
1answer
22 views

Cannot locate a notification email

I think I have found another odd thing using SharePoint 2013. I have a custom list that sends notification emails. There are 5 working SharePoint Designer workflows connected to it that are sent at ...
1
vote
1answer
50 views

How to get ClientContext in Sharepoint Online with JSOM

var context = SP.ClientContext.get_current(); throws this error, Uncaught ReferenceError: SP is not defined the snippet works fine in SharePoint 2013, Are there .js that I need to load? if yes, ...
0
votes
0answers
13 views

How to retrieve files inside folder based on custom filter in document library using java script

I need to filter documents in document library folder based on custom column name(My column name is ProjectManager and it is single line text)using CAML query. I tried with below code but it is not ...
1
vote
1answer
39 views

How to get item ids when using JSOM (when not it in content.executeQueryAsync)

is it possible to get item ids when not using executeQueryAsync. See my code below. I would like to get the item ids as i'm doing below in successGetListItemId() but would like to store in an array ...
0
votes
0answers
24 views

How to use SweetAlert Sharepoint 2013 server [closed]

I want to use sweetAlert in my web part. Normal js alert work fine but sweet alert didnt work. here my js code; <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> ...
1
vote
1answer
17 views

Using JavaScript and DOM manipulation to create Cascading Drop Down but rendering incorrectly

I have a simple list that has two drop downs. I am using JavaScript to create a cascading drop down functionality. A reference to my JavaScript file is placed in a content editor webpart of the list ...
2
votes
1answer
24 views

Calling executeQueryAsync in each loop for sharepoint javascript

I want to update table rows with information from a Sharepoint list. So, I am calling executeQueryAsync within a For Loop and it only updates the last item, but not all. var oRows= $('#dataTable tr');...
1
vote
0answers
14 views

XML error when searching an item in SharePoint list

I am using a custom JS (which is borrowed) to show repeated section as in a more readable format, which does work fine. However, when using the search field then it throws an XML Invalid error... ...
1
vote
0answers
33 views

How to remove list from site when spfx web part removed?

Modern SPFx web part creates a new list 'abc' using code when it is added to site contents. Now I want to remove list 'abc' automatically when web part is removed from site contents(using code not ...
1
vote
1answer
32 views

AJAX REST call to POST to SharePoint list generates error

I am having difficulties with the JQuery implementation of AJAX to make REST calls to POST data to add items to my SharePoint list. Using 'GET' to retrieve information gives me no issues. Given the ...
1
vote
0answers
18 views

Dom changes using javascript Cancels out Css [closed]

I am brand new to programming and javascript, and recently I tried practicing javascript with a website I created and whenever I declare any change in the DOM the website loses its css. Example: ...
0
votes
0answers
24 views

Return List values to Array and use in chart script

This is sort of a two part questions so I hope this ok... … I am using an open source chart plugin called chart.js I want to return values from list items to then be used in the charts for labels, X ...
1
vote
1answer
32 views

to get all the values of the managed metadata column

I have a managed meta data column in my list "Employee" named "Office Location". the metadata column refers to a TermStore "headquarter". How do i get all the values of the termstore in javascript to ...
2
votes
0answers
16 views

permissionKind returns void in React

I have a search function that returns all list items including their parent link based on their content type, tenant-wide. Every list item comes from a specific subsite and I want to split the ...
1
vote
1answer
18 views

Jquery code doesn't work after SharePoint ListView paging

I wrote a custom onclick event for a class in jquery, I have attached the script with JS link of listview web part. There is default paging in the listview web part. In first page the click event ...
0
votes
0answers
24 views

DocumentID Links sending users to search page

I built an app that returns files in a document library. and provides links to those files using documentIDs. We migrated the site from 2013 to 2016 and now the links instead of opening the files, ...
1
vote
2answers
60 views

Using Javascript REST API to do asynchronous batch POST to multiple SharePoint lists

I'm in a bit of a quandry as I'm just learning how to do development in SharePoint 2016 / SharePoint Online and using Javascript to perform REST calls. I have a form that is using REST to successfully ...
0
votes
1answer
42 views

Change a specific column of a specific item

I have a column WhoRead(type: "Person or Group") and an onclick event. When I click on an item I want to fill the column "WhoRead" with the current user email. I already have the code to get the ...
1
vote
1answer
26 views

Sharepoint 2013 Retrieving values from list and autopopulate input fields using javascript

I have this list And I have this form Which has to be autopopulated when the user input the Employee ID from the list. Thanks
0
votes
1answer
20 views

Adding body to mailto:XXXX@email.com?Subject=Test in SharePoint list view

I am trying to add body to an email that i sending through JavaScript. I have a SharePoint list view when clicked on sends an email to EmailID. This works fine, var mail=&quot;mailto:&quot;+...
0
votes
0answers
44 views

Trying to show list items based on the currents user permissions (view)

I have a search functions that get list items as well as their parent URL (each a sub site) from an tenant. I want the current user to be shown only the list items where their parent site (URL) have ...
0
votes
1answer
41 views

Print all list items of particular user in SP list?

It's my first time here and very new in SP. I have created a list for overtime of staffs. one overtime per list item. At the end of the month, the requirement is to print all overtime made by a ...
1
vote
1answer
28 views

Make a Chart with multiple Sharepoint lists (using AngularJS)

few days ago I posted a question on how to do a Chart with AngularJS of a sharepoint list, here's the link. Now I have a more complicated one: how to make a chart with multiple lists? I'm using ...
0
votes
0answers
21 views

Auto email SharePoint Online list InfoPath form as pdf on Field status completed

Anyone know a way to export and auto email a SharePoint Online list's InfoPath form as pdf on Field "Status" completed? Trying to have the form sent out as an email attachment automatically on ...
0
votes
1answer
29 views

Dynamic calling function to read data from SP List

I'm trying to do something similar to this, but with a dynamic calling function name so that I can reuse the function. I followed Danny's suggestion, but I am getting the error: Uncaught TypeError:...
0
votes
0answers
18 views

Cascading Dropdown Based off of Multiple Values

I am new at SharePoint so bear with me. I have 3 lists. Item Type, Manufacturer, Model. Now, if I'm the user.. I go to my new form page, and I select my item type from a dropdown (based on a lookup ...
0
votes
1answer
32 views

can't find sp.runtime.js

Trying to use a people picker in a sharepoint online MVC add in but when I try to import the javascript files needed I get "not found" error in the Error List. This is how I try to import the files &...
0
votes
2answers
47 views

sharepoint get list item returning wrong date time

i noticed while testing that the sharepoint get list item call i am making through pnp sp is wrong. i tried going to the endpoint url directly to check but the return date is the same (wrong date) . ...
1
vote
2answers
22 views

CAML Query for retrieving only document library items in only one folder

I'm trying to access the documents in a specific folder in a SharePoint document library. the library has multiple folders but I do know the name of the folder. here is an example of the file tree (I ...
0
votes
0answers
26 views

REST call for fields: “Type cannot be null”

I'm making rest calls to get a lists fields in a custom JS application. For some reason it's failing when I make the call through the app but when I do it in the console it works fine. I'm using ...
0
votes
1answer
8 views

Provide user a filtered set of managed metadata column values for filtering on a list view

Background/Problem Our customer recently switched from a choice column to using a managed metadata field to capture data in a list. They really love the ability to add new values on the fly, as well ...
1
vote
0answers
13 views

Print Fieldset Expanded Using Javascript [closed]

My HTML is : <input type="button" value="Print" id="btnPrint"> <fieldset id="FieldsetLegal" class="collapsible collapsed"> <legend id="legleg">Legal </legend> &...
1
vote
2answers
37 views

Get user logged on sharepoint online

I need to create notifications for every user who didn't read a specific new on the site. To do this i need to see who user is logged in the site and then save this info into a list on Sharepoint. The ...
1
vote
1answer
36 views

How to encode url in sharepoint using javascript

I have created an html page an used the following javascript to encode url entered in a text box. However, it does not ecode all characters. I used a search url and tried to encode, but does not ...
1
vote
0answers
23 views

Change web page property that's not for the current site

I've tried lots of workarounds and have come up with nothing. I'm trying to do this: https://stackoverflow.com/questions/25595512/javascript-csom-to-access-page-properties But since I need a page ...
1
vote
1answer
37 views

How to get access token to create a list

I'm trying to create a list with javascript. From the Sharepoint API Documentation: url: http://site url/_api/web/lists method: "POST", body: { '__metadata': { 'type': 'SP.List' }, '...
0
votes
1answer
44 views

Caml Query problem, cannot complete this action

I am new in sharepoint development, Can anyone please help me find an error in this query? I am using javascript to retrieve records. The where clause is based on status and priority fields. Query ...
0
votes
2answers
88 views

Make a Chart of a sharepoint list using AngularJS?

I want to implement a Chart of a Sharepoint tracker list. I decided to use angular-chart.js, to use this code I also needed Charter.js. So I downloaded both and decided to make a try as one of the ...
0
votes
1answer
22 views

add attachments with javascript on item edit

I'm using SP Online. I have the following code to update a list item. I added this code in a script editor inside EditForm.aspx. It works fine and I'm able to update several fields, but If user adds ...
1
vote
0answers
27 views

SharePoint promoted links on multiple rows with scrolling

Is there a way for SharePoint to displayed promoted links in 2 rows and still maintain the scrolling feature? When I added this script to display multiple rows I lose the scrolling feature. script ...
1
vote
1answer
34 views

How to use class instead of Id for SharePoint PeoplePicker using JavaScript

I have created a Form on SharePoint using SPD, where I have used SharePoint PeoplePicker to get the User automatically. Below is the code:- $(document).ready(function () { // Specify ...
0
votes
2answers
50 views

Get Current Login User Profile Property in SharePoint SPS-DistinguishedName

For another application, I need to fetch a property of the current logged in user profile in sharepoint. (SPS-DistinguishedName) I've got this code, which works perfectly, pasted line by line into the ...
0
votes
1answer
31 views

Floating button to submit new list item

I am trying to find information on creating a button that I can have "float" at the bottom right or left of a SharePoint page that when clicked will open a dialog box for a new list item to be saved. ...
0
votes
1answer
46 views

React Native (Sharepoint-application)

I have started learning to code in react native. Have an idea of trying to create an application that (creates / updates / deletes) data from SharePoint lists. My question is: How do I create a ...