Skip to main content

Questions tagged [spfx-webparts]

Technical questions about building and using web parts based on the SharePoint Framework client-side development model.

Filter by
Sorted by
Tagged with
0 votes
1 answer
4k views

How to best implement pagination for a spfx web part displaying a list of links?

I have a web part that displays a filtered list of links based on the logged on users profile properties. Its working well, but I cannot work out the best way of adding pagination. The list is never ...
0 votes
0 answers
18 views

SPFx Webpart to retrieve term store terms

I am working on a simple SPFx webpart with minimal framework (no react), to retrieve terms from the term store. I am following the instructions from the PnP site but running into an issue I cannot ...
0 votes
1 answer
1k views

WebParts keep loading untill I scroll down the page or perform a zoom

environment:SharePoint online;Sharepoint Framework; Programming languages:TypeScript During page loading, sharepoint custom web part keeps on loading Nothing does change untill I scroll down the ...
5 votes
1 answer
4k views

"Either Guest user or Cortex is not enabled!" on SP page

I get this error: "Either Guest user or Cortex is not enabled!" in the browser's developer console when I run my published webpart. It first appeared around October 26th 2022. The error ...
0 votes
1 answer
2k views

OAuth authentication for SPFx solutions

I am challenged by a SPFx based solution (WebPart as well as Commandbar-Extension). I have a set of APIs which are secured by OAuth. There is a dedicated authentication server, so I can't just use ...
0 votes
1 answer
2k views

SPFx TextField component setState

New to SPFx and React. I'm trying the set the state of a TextField when I enter data into the react component and eventually use a button to drop it into a list. This is bringing information into the ...
0 votes
1 answer
29 views

Upgrade SPFx webpart to specific node version

I have one old SPFx react webpart created in Node version 10.18.1. Now I have install node version 18.19.0 How can I Upgrade my old SPFx react webpart into new node version 18.19.0?
1 vote
2 answers
2k views

Cascading dropdown list in SPFx web part

Can someone help me with this issue as I would like to create cascading dropdown lists inside the web part itself and not in the property pane. I have found this code in [github react-...
0 votes
2 answers
26 views

SharePoint Framework on SharePoint Server 2019

Which node and which gulp, yo and so on I should install before developing SharePoint Framework on SharePoint 2019 server. I tried node 11.15. and now I'm try to fight with node 12.22.12 and I can't ...
0 votes
1 answer
2k views

Uncaught TypeError: Cannot read properties of undefined (reading 'context') in spfx

When I am checking my published document that time I am facing this problem, before this it was running fine.
0 votes
3 answers
379 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
1 answer
26 views

Preventing my Sharepoint Online WebPart from being cache

I got a SPFX WebPart for Sharepoint online that seems to be working fine, but now we notice that when i deploy a update some of the users keep getting the old versions, and hard refresh does not ...
0 votes
1 answer
22 views

How to add a filter query to see specific email addresses in Search Results of PnP Modern Search?

I already extracted employees belong to specific Departments by using this query which I added to Query Template inside Search Results of PnP Modern Search: {searchTerms} Department:"Accounting&...
6 votes
2 answers
3k views

Remove spfx webpart

I've uploaded and deployed some spfx webparts through my App Catalog site. Now these webparts are not useful anymore so I've deleted them from the App Catalog. Then I've checked my sites and ...
4 votes
2 answers
2k views

SPFX and react-router

I'm having trouble getting react-router working on my SharePoint Web Part with React and TypeScript. I have tried react-router as a standalone webapp and it works fine. Just can't get it working on ...
3 votes
3 answers
2k views

Is it possible to open modern item edit form panel from custom SPFx webpart?

Is it possible to open EditForm panel from my SPFx webpart? Something like in list view, if an item is selected, side panel appears with read-only properties and a button "edit all" enables user to ...
2 votes
1 answer
1k views

Using .env files with SPFx components - Undefined issues

I'm having a nightmare with using environment variables in my SPFx project. I have: a .env in the root of my project variables within this file all starting with REACT_APP_ references to these ...
1 vote
1 answer
2k views

Taxonomy Field Values/Filtering with SPFx

I'm looking for some examples or guidance for working with taxonomy fields in SharePoint Framework. What I need to do is have a field that is tied to a TermSet. Based on the user's input into this ...
0 votes
0 answers
10 views

Why aren't my files uploading properly?

I've written a 'File Upload' button for my spfx app, and it appears to work, but the file isn't being uploaded properly. The user sees a form which allows them to select a file (from their PC), and ...
4 votes
1 answer
2k views

How can I force SPFX webpart to not show cached data in SharePoint online

I have created a SPFx webpart which reads parameters from page URL query strings and renders data accordingly. After the page is loaded and I press back button and again access the page with ...
0 votes
1 answer
33 views

Difference between display of webpart in page in edit mode and page in publication

Hello i deployed my webpart on Sharepoint Online on a page and i see a difference in display between edit mode and published page. The webpart contain a scss that i use thanks to declare module "*...
1 vote
1 answer
1k views

How to retrieve image from a SharePoint Online Document Library using SPFx using filters

public render(): React.ReactElement<IFlowDiagramProps> { // const docRelativeUrl :string = event.selectedRows[0].getValueByName('FileRef'); var str=""; var usemaps="";...
0 votes
0 answers
138 views

SPFx Cannot read properties of undefined (reading 'id') in web part using workbench

Each time I tried to launch my web part through the workbench I got this error, I don;t understand why.: Cannot read properties of undefined (reading 'id') PILE DES APPELS : TypeError: Cannot read ...
0 votes
1 answer
2k views

SPFx app not showing up in the webpart list

As I am new to SharePoint Framework, I am trying to update an existing web-part (updated the version in package-solution.json). Updated .sppkg file in app catalog (overwrite), shows new version number....
0 votes
0 answers
32 views

PnP modern search web parts custom

I want to add slider in search result where on button click I can get data from different list with help of lookup on that slider. I don't want to customize whole PnP modern search result webpart code ...
0 votes
1 answer
59 views

SPFx web parts missing in SharePoint 2019 modern sites

I'm trying to use an SPFx that contains some custom webparts on SharePoint 2019 (spfx-40-fantastics, you can find it in GitHub). After deploying the SPFx everything works fine on classic sites, I can ...
0 votes
1 answer
2k views

CSS classes added in project.module.scss not showingUp in my .tsx file in SPFx Project

Currently I started working on React SPFx webparts and wanted to add some new CSS. I added some styling to classes in Project.Module.scss. But Now when I am adding this class names in render() method ...
0 votes
1 answer
3k views

SPHttpClient undefined error: Using React JS to add item in SharePoint list

I'm trying to add an item in SharePoint Online list using SPFx solution where I'm using React JS to perform the action. Below is the copied code, when debugging it says that: "VM242:1 Uncaught ...
0 votes
1 answer
1k views

Multiline text field JSON to array - SharePoint SPFx

I'm building a webpart application using SharePoint SPFx with react. I would like to use SharePoint's multiline text field as a way to store an array. I saw this thread here which said you can convert ...
0 votes
1 answer
41 views

What is the license for the SharePoint Framework (SPFx)?

I am working on a project that involves the SharePoint Framework (SPFx) for developing custom web parts and extensions. I would like to understand the licensing terms for using SPFx. Specifically, I ...
0 votes
1 answer
1k views

react-search: The type definition `index.d.ts` does not exist. Create one and try again

I am new to SharePoint and I'm trying to deploy a modern Search Web Part following the instructions here sp-dev-fx-webparts/samples/react-search/ When I run tsd install on the command prompt, it ...
0 votes
2 answers
2k views

Display Rich Text in SharePoint Online

I am trying to display the rich text in a list item . I tried using the JSON formating, but it does not seem to have any support for "Enhanced rich text". The txtcontent converts the rich text to ...
0 votes
0 answers
52 views

Managing and customising modern Event list/page - SharePoint Online

The Event List is one thing that is very confusing in SharePoint Online and I just need some other people views and ideas on this. My requirements I need to be able to add new fields to the event ...
0 votes
2 answers
2k views

SPFX MSGraphClient - Cannot read property 'id' of undefined

I am getting this issue when calling Shared and Recent OneDrive files using MS Graph Client on my modern webpart. Uncaught (in promise) TypeError: Cannot read property 'id' of undefined I get the ...
2 votes
1 answer
2k views

how to use react-bootstrap in SPFx webpart

installing react-bootstrap straightforward; "npm install react-bootstrap --save" and "npm install @types/react-bootstrap --save" then add references import FooButton from 'react-bootstrap/...
0 votes
4 answers
5k views

getting current logged in user in SP list

I have made one webpart using spfx, on submit button its values are pushing in SP list but in SP list I want user who is currently logged in, its value should come in one of the field of Sp list, how ...
0 votes
1 answer
3k views

Retrieve item ID after adding to SharePoint list using PNPJs

I'm building a SharePoint SPFx react app. In a nutshell, the user fills out a form that I created. When the user hits submit, using PNPJs: https://pnp.github.io/pnpjs/sp/items/ I'm adding the item to ...
1 vote
2 answers
1k views

SharePoint Framework/ issue/ drop down change event on web part/

I want to use drop down control on SharePoint framework webpart(done) and on change event to call some method/ some rest api and so.but it is not allowing. I did not find any article where spfx web ...
1 vote
1 answer
2k views

How to use people picker control using sp-pnp-js( Pnp-JS-Core) library and save users selection in Person or Group type column in Sharepoint List?

As I am new to Sharepoint framework, I wan to know how can I use the people picker control using sp-pnp-js library and save the users selection in Person or Group type column in Sharepoint List.... I ...
0 votes
0 answers
28 views

How do I make a SharePoint Web Part work when installed on a SharePoint instance that uses a vanity URL?

My team has developed a SharePoint integration that uses the SharePoint Web Part framework to embed a page from our application on a SharePoint page. This is working well for most of our customers, ...
0 votes
1 answer
5k views

document.referrer sometimes returns blank value

Page A contains a DetailsList, which has links to different pages. Page B contains a file viewer web part. Clicking on any of the links on "Page A" DetailsList row items, directs the user to ...
1 vote
4 answers
3k views

Is it possible to change the owner of a group using Rest API?

I am creating Sp groups and the Owner gets set to whoever runs the script. I am trying to set the owner to another group or user and it is not working. The SP.Group documentation says it should work ...
0 votes
1 answer
106 views

Is it possible to remove/disable News templates in SharePoint Online

I have a requirement and what i'm after is for users to be able to create a news post but i want them to use a specific template only and not to be able to use any of the other templates from ...
0 votes
1 answer
2k views

SPFX create and use an array

As a newbie to SPFx, how do I create and use an array? everything I've tried fails to populate the array. let CustomerList: Array<any> = ['1', '2', '3']; let array1: any = ["Panda", "Zebra", "...
0 votes
1 answer
80 views

Multilingual SharePoint Framework (SPFx) - switching language

I'm adding multilingual support to an existing webpart. Easy enough with the different locale string files and testing with the --locale pararmeter on gulp serve. What I don't understand though is ...
0 votes
1 answer
1k views

React.js: avoid delay on element <input type=“file”> onChange event

Any react-specific solution to the problem, described here? https://stackoverflow.com/questions/46072489/how-to-avoid-delay-on-element-input-type-file-onchange-event?noredirect=1&lq=1 Basically ...
0 votes
2 answers
3k views

Unable to remove left navigation from a SharePoint Page

I have a SharePoint Online page created with a template, which I cannot remove the left navigation pane from. (I can edit the list of links, but I want to remove the whole pane completely). Ideally I ...
5 votes
1 answer
2k views

SPFx web part not showing from the catalog

Followed the video from SharePoint Framework development with SharePoint 2016 Feature Pack 2 but could not add the web part to the site because it did not show up. I made sure I have only SPFx 1.0....
0 votes
2 answers
1k views

SPFX ClientSideAssets folder and dist folders have old code

When I build my solution, minified JS files have my old lines. Here are my steps: 1 - gulp clean 2 - gulp build 3 - gulp bundle 4 - gulp package-solution --ship file under \dist\test-web-part.js file ...
0 votes
0 answers
17 views

One WebPart not showing up in workbench while another shows up ok

I'm new to SPFX, and I'm trying to create a couple of web parts. I downloaded the Contoso Retail Demo and have basically cannibalised it to create what I need. The demo had multiple web parts in one ...

1
2 3 4 5
26