Questions tagged [spfx-webparts]
Technical questions about building and using web parts based on the SharePoint Framework client-side development model.
1,255
questions
0
votes
0
answers
98
views
SPFX to check list contains field name
I have used the code from https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-list-form.
Based on the code above, I need add additional condition.
The code below I can get listId, and ...
1
vote
1
answer
18
views
Dependency issue using viva connections extension in VS code
I have installed the Viva connections extension in VS code. When I create a new project I get this error:
[2023-04-26T19:04:44.654Z] [INFO]
Running command: yo @microsoft/sharepoint --solution-name &...
0
votes
0
answers
21
views
Sharepoint isn't automatically creating my path to CDN
I've created an SPFx Webpart and uploaded it to my app catalog, however it just says , and once I add my webpart to a page it throws the errors in the screenshot I'm attaching, because it's unable to ...
0
votes
1
answer
108
views
How can I configure a SPFx webpart project to launch in a specific browser during development?
I want to use the Brave browser with a specific user profile to work on multiple SharePoint sites. Currently, when I run the gulp serve command, the webpart project launches in the OS default browser, ...
1
vote
0
answers
35
views
Data mismatch while making a list call to get data from SP list
I'm trying to get Data from SP List through rest API from SPFX, I've checked by running that rest API directly in the browser where it shows correct data but while making a call from SPFX that rest ...
0
votes
0
answers
183
views
Deploying a Teams tab (personal app) using SPFx without full tenant admin privileges
I'm trying to deploy some Teams tab samples (teams-tab-spfx-client) so I could add webparts my team made as a personal app or group tabs. I was able to run this sample on the site's workbench and ...
1
vote
1
answer
153
views
Is it possible to create DetailedList with expanded/collapsed rows?
Is it possible to create DetailedList with expanded/collapsed rows?
Please see mockup from figma:
I have project like on image attached and need to figure out how to achieve such layout with Fluent ...
0
votes
1
answer
33
views
Preview not showing while add SPFx app under Communication site
I have added the SPFx app under the SharePoint Online communication site.
When I tried to create a new page from the Home page and select Apps.
SPFx app preview not showing. Please refer to the below ...
0
votes
1
answer
166
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 ...
0
votes
1
answer
175
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"...
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): ...
0
votes
1
answer
32
views
Insert time in default weather web part
By default we have the weather and location web parts in modern SharePoint Online site.
How can I add the time in the weather web part for a specific location?
Where can I find the source code for ...
1
vote
0
answers
39
views
Facing issues while create Sharepoint lists with lookups columns using xml
I want to create two list 1) Employee details and 2) Selected Employee programatiocally using XML in SPFx.
So, I have created two files for each list 1) element.xml and 2) Schema.xml. And added that ...
1
vote
1
answer
110
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 ...
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 ...
1
vote
1
answer
809
views
SPFx web part shows an error when viewed by external users
I have created my first web part following the steps in the Microsoft documentation tutorial. After struggling with many of the steps, I managed to get the web part up and running and added it to a ...
0
votes
2
answers
309
views
If I have a SPFx project with two webparts, is it possible to bundle/package only one of the webparts?
I have an SPFx project with two webparts.
-src
--webpart1
--webpart2
When I run gulp bundle --ship and gulp package-solution --ship both webparts are packaged. Is it possible to only package one of ...
0
votes
2
answers
485
views
SPFx Retrieve lists using SharePoint REST API
I am trying to create a web part to deploy to SharePoint Online. Following this Connect your web part to SharePoint.
When I add the code below. I receive the errors below.
Do you have to have Office ...
1
vote
1
answer
241
views
Fetch the targeted content from a SharePoint list using Rest API
I have a SharePoint list on which Target Audience is enabled.
There is a custom list SPFx webpart which shows the list items using the Rest API.
I want to display the content based on the targeted ...
0
votes
1
answer
155
views
CAML Sharepoint list to return email of Person Field
Goal: I have a Person column on a SharePoint list called Manager and I'd like to return the Manager Email for each list item as well as the value of a managed metadata field. I'm using the PnP JS ...
1
vote
1
answer
172
views
How to create a service scope using a sharepoint url passed in from an spfx property pane value
I'm using the service template found in the PnP JS documentation:
export class SampleService {
public static readonly serviceKey: ServiceKey<ISampleService> = ServiceKey.create<...
1
vote
1
answer
461
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
122
views
PropertyFieldCollectionData control Panel customization
Is it possible to edit No data in your collection text in the panel? See the image below.
I need to change the text depends on the user language.
I am able to change the text in Save and cancel ...
0
votes
1
answer
494
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....
0
votes
1
answer
496
views
Is there any problem if my SPFx requires "node": ">=16.13.0 <17.0.0" while my node.js version is "14.18.1"
I want to deploy this SPFx sample inside my tenant @ https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-chatgpt-app. Now inside the package.json file below is mentioned regarding the ...
0
votes
1
answer
559
views
How can I get data from azure web API in SPFx web part?
How can I load data from azure web API into SPFx web part?
API:
https://someazuresite.azurewebsites.net/api
Code I am using currently:
this.props.context.spHttpClient.get(`https://someazuresite....
0
votes
1
answer
67
views
Send query to result page from custom search box
How shall I send my query from search box to result page if below is my code in react js:
this._handleSearch.bind(this)
<SearchBox
styles={searchBoxStyles}
placeholder="...
0
votes
1
answer
259
views
It is fine if we store the Chat GPT api key inside the SPFx web part properties
I want to embed a chat GPT inside our SharePoint and i found this web part @ https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-chat-gpt .but the issue is that it stores the Chat GPT ...
0
votes
0
answers
2k
views
Tracking down an error from SPFX web part that started yesterday
I have a Spfx web part used on a page in Sharepoint Online that's been in use for over a year. It hasn't changed in at least two months. It uses chart.js to display some data from an api call.
...
0
votes
2
answers
242
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
231
views
SPFx to add watermark to PDF before downloading it
We need to develop SPFx web part, which show pdfs from our document library inside SharePoint online site collection. and we need the SPFx to add bookmarks to the pdf on runtime before downloading it, ...
2
votes
0
answers
41
views
HTML in Long Description of SPFx Package-Solution
According to the schema for a SPFx package-solution, the longDescription, which is located under metadadata should accept HTML. I have been able to put newline characters (using \n) but not HTML.
...
2
votes
1
answer
159
views
SPFx SCSS - how do I reference third party classes along with my class to increase the specificity of my selector?
** For simplicity's sake I am not going to include all the Typescript stuff in my code examples here, so please just roll with it.
I'm using Semantic UI React as a UI component/styling framework for ...
2
votes
1
answer
359
views
SPFX Property Pane property Undefined
I have added a PropertyPaneSlider control to an spfx web part. The control displays on the page and appears to be configured correctly.
I want to get the value of the control from the properties ...
0
votes
2
answers
281
views
Web-Part works on localhost, but it does not working on SPO
I have a webpart, which works on my localhost fine, i can read items from List "A", and can write items in List "B".
I deploy it on my site collection, so I add the sppkg file in ...
1
vote
1
answer
512
views
SPFx web part to modify left navigation
Is it possible to build a SPFx web part which can replace the left navigation? I would like to create my own navigation that will use a treeview control.
When I edit my sharepoint site I can insert a ...
0
votes
2
answers
650
views
DefaultButton onClick action aborted without any error message
I'm working on a SharePoint Webpart and my DefaultButton has brocken.
I load items to an office-ui-fabric Dropdown from a SharePoint List. It's working fine, I get the value of the selected options, ...
0
votes
0
answers
68
views
SPFx: pnp.np.search how to get results by the PATH that have a specific value
I making a simple SPFx. I would like to sort results by the path that only contain "/Lists/" in url.
pnp.sp.search({
RowLimit: 20,
StartRow: 0,
...
0
votes
1
answer
1k
views
Property 'get' does not exist on type 'IFields'
In SPFx Webpart properties, as a cascading drop down showing all list/library from the current site, based on the selection of the list, trying to show the list fields.
var spListColumns = _sp.web....
0
votes
2
answers
1k
views
SPFx: pnp.sp.search how to get only list items
I made search in SPFx, now i need to display only list items. My code example:
pnp.sp.search({
Querytext: query,
RowLimit: 20,
StartRow: 0,
QueryTemplate: "...
0
votes
1
answer
166
views
SPFx: pnp.sp.search what is Refiners and how them to use?
I making simple SPFx search. I need to use Refiners to get data from SharePoint. Which Refiners is available to use? Can you please give me example with Refiners?
pnp.sp.search({ Querytext: queryText, ...
1
vote
1
answer
297
views
SPFx: which QueryTemplate can I use in pnp.sp.search?
I wonder which QueryTemplate available to use with pnp.sp.search?
For right now I find only one property :"(IsDocument:True)"
pnp.sp.search({
Querytext: query,
...
0
votes
1
answer
116
views
SPFx: pnp.sp.search result how to search by date
I'm using pnp.sp.serach to search files and folders.
I need to search by file's and folder's date.
I see results have properties LastModifiedTime, but the value came undefined.
pnp.sp.search({
...
0
votes
1
answer
316
views
SPFx: sort pnp.sp.search how to make query search results by start and end date
I am making simple SPFx search for SharePoint folders and files. How can I make search query that search results between start and end dates using QueryTemplate or Refiners properties?
return new ...
1
vote
1
answer
228
views
SPFx PNP people picker error for allowUnvalidated
I am using PNP SPFx React PeoplePicker in my SPFx webpart. But when I add allowUnvalidated property to my PeoplePicker. I get this error:
Property 'allowUnvalidated' does not exist on type '...
4
votes
2
answers
183
views
Is SharePoint Framework Web Part Running in the SharePoint App?
Is there a way to determine in code if an SPFx web part is running in the SharePoint App rather than in SharePoint in the browser?
0
votes
1
answer
510
views
SPFX: make a search by current website with pnp/sp
I need to create SPFx with search that scope of search will be full website and it will be searching by using pnp/sp.
I find code that only searched by list name, but I need search by full website.
...
0
votes
1
answer
74
views
Unable to get preview of a msg file from SharePoint REST API
How can I get preview URL of a msg file? I’m developing a custom search web part in SPFx framework.
My code:
Const sp = spfi(“https://home.sharepoint.com/sites/site/").using(SPFx(this.props....
1
vote
1
answer
1k
views
gulp serve error
I'm trying to work on a project of a SPFx web part. The project was built normally but when I try to test my web part on my tenant the following error occurs:
Error: Your dev environment is running ...
0
votes
0
answers
18
views
When we do save as draft we are getting old field value for the property pane field , why its happening and how to get latest value on save as draft?
We are having GUID in the webpart property pane, But when we edit that in sharepoint page its giving correct value but on save as draft , again the previous value is getting populated for the guid, ...