Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
9 votes

How does one pass parameters to SharePoint Framework Extensions in practice?

Using Properties in Your Extension The this.properties property of your extension are defined by the Interface you setup. By default, the interface gets defined in your main extension class file. ...
user avatar
  • 5,308
9 votes
Accepted

Can SPFx Webpart and Extension exist in a single app?

Yes, you can have multiple webparts or extensions in the same solution. Think of it as a Visual Studio solution with multiple projects (i.e one sln file and multiple dlls). To add a webpart/extension ...
user avatar
  • 30.2k
9 votes
Accepted

What is difference between SharePoint Framework (SPFx) Extensions and SharePoint Framework (SPFx) Web PART

Web parts allow you to create components that can be added by content editors as content on a page. Extensions add functionality to known areas of pages on an entire site or site collection, for ...
user avatar
  • 1,156
8 votes
Accepted

Does Virus affected Node Modules transfer in Contents of SPFx deployment package

TLDR; The short answer is no, the package doesn't contain all of the code from node_modules, yet it contains some very small amount of proven code (mostly css-loader code from corresponding ...
user avatar
8 votes

Using Office Fabric UI icons in a SPFx extension

This is currrently a SPFx limitation. You cannot directly use Fabric UI Icons as command set icons in SPFx list extension. Currently SPFx extension allows you only 2 ways to set extension icon, 1) ...
user avatar
  • 30.2k
7 votes
Accepted

SPFx Extension - Page Context is missing

No its not removed or deprecated. Its working correctly . Just upgraded a sample and was able to work with the this.context object without any issue. You need to ensure that you are using it inside ...
user avatar
  • 30.2k
6 votes

Can I target an existing column with a Field Customizer extension in SharePoint Framework?

This is possible by associating FieldCustomizer to existing field. Field object has ClientSideComponentId property, which should be updated to match the identifier of the FieldCustomizer manifest ID. ...
user avatar
6 votes
Accepted

SharePoint Framework (SPFX) onInit() Promises

Batching the 2 requests as suggested by Venkat Konjeti is a great idea, but the question of how to delay your render until these are finished is demonstrated in the jquery-application-toastr sample (...
user avatar
  • 5,308
6 votes
Accepted

How to tell if page is in view/edit mode in SPFx?

The correct answer is valid but it will not cover all the scenarios, if you need to detect the edit mode from an SPFx solution on a classic page the Mode=Edit will not be available. A more reliable ...
user avatar
6 votes
Accepted

How to update ListView within spfx commandset to show new item

There is a Microsoft sample project on github that does exactly the same. Looking at their code, it does mention that there is currently no way to refresh just the list view and their solution seems ...
user avatar
  • 4,415
6 votes
Accepted

SPO updates impact on SPFX components

Disclaimer - I don't work for Microsoft and cannot officially speak on their behalf. However, I do work closely with the engineering team and am very familiar with SPFx and long term plans. SPFx ...
user avatar
  • 5,308
5 votes

SPFX - Listview command - Get current folder

It is pretty easy. Because you know which item is selected, you know url of the file. event.selectedRows[0] holds a lot of information about the selected item. Or you can use query string. @override ...
user avatar
  • 1,661
5 votes
Accepted

SharePoint Online SPFx Apps: Why use a CDN for assets, why not simply use the SiteAssets library?

The tutorials configure a library or folder in a Doc Lib as CDN because of the immense performance benefits that are gained once it is enabled. In our tenants, post enabling of CDNs, we saw a ...
user avatar
  • 30.2k
5 votes

_spPageContextInfo in modern pages

Try using below solutions: Solution 1: Use legacyPageContext to access the pageContext information: // This is how you can access the page context info this.context.pageContext.legacyPageContext; /...
user avatar
  • 27.7k
4 votes
Accepted

SPFX - Listview command - Get current folder

SPFx has some utility classes to help you get the folder url. Its not available in pageContextInfo or any other page property. However, you can split it from the query string's Id parameter. Add the ...
user avatar
  • 30.2k
4 votes
Accepted

bootstrap menu dropdown not working with SPFX -extensions

1) If you are adding jquery & bootstrap via CDN, no need to npm install them 2) bootstap components depend on jQuery. So, you need to first load jQuery and then bootstrap js. You can specify the ...
user avatar
  • 30.2k
4 votes
Accepted

NodeJS not compatible

You can use nvm (node version manager) to quickly switch between different nodejs versions. Download for windows or OSX version. How to use Install nvm $ nvm install 8.11.0 - installs nodejs ...
user avatar
4 votes

Getting Teams Context information in SharePoint Framework extensions

Interestingly I found the way to get Teams Context information in SPFx extension. Follow the below steps to do it: Do "npm install @microsoft/teams-js --save" in your SPFx extension project. In your ....
user avatar
4 votes

SharePoint framework yo not showing all the options

You have to select "SharePoint Online only (latest)" or "SharePoint 2019 onwards, including SharePoint Online" for the question Which baseline packages do you want to target for your component(s)? to ...
user avatar
3 votes

Is there any alternative of model-dialog available for SharePoint Modern Page?

Update: Based on this, numerous customization options are not supported in the modern list/library like jslink field and view customization, custom css via alternate css url, custom masterpages, ...
user avatar
  • 30.2k
3 votes
Accepted

How does one pass parameters to SharePoint Framework Extensions in practice?

theChrisKent's answer set me on the right track, but as I noted in my comment on his answer, I was really looking for something that could be used from a web interface (such as a client side webpart), ...
user avatar
  • 348
3 votes

How to tell if page is in view/edit mode in SPFx?

When the modern page is in edit mode. you can find there will be query string added on the url Mode=Edit. if you remove that query string the page will go in read mode. you can get query string values ...
user avatar
3 votes
Accepted

SPFX Extension ListView - nothing happens after "loading debug scripts"

Recently, SPFx extensions have moved from preview to RC. So, this has introduced some breaking changes for extensions. MS has deprecated onRefreshCommand method and suggested that you use the ...
user avatar
  • 30.2k
3 votes

Can I target an existing column with a Field Customizer extension in SharePoint Framework?

As Vesa suggested, you can update the existing site column 'StockAvailable' property "ClientSideComponentId" by using pnp powershell. Set-PnPField -Identity 'StockAvailable' -Values @{...
user avatar
  • 2,317
3 votes
Accepted

How to get Share URL from command set?

To get the Share URL, you can use any of the 3 approaches mentioned below: Option 1 - using ServerRedirectedEmbedUrl You can make use the ServerRedirectedEmbedUrl to get the URL as below: event....
user avatar
  • 30.2k
3 votes
Accepted

Sharepoint Online/O365 custom fonts

As you know, the officiel Theme Palette is quite limited concerning customization of your site. I've personally been using SharePoint Framework to customize it's appearing. When you make a SPFx ...
user avatar
3 votes
Accepted

SPFX Field Customizer: how to get full path of document in document library?

You can use event.listItem.getValueByName("FileRef") to get the path of the document in library. This will give you a server relative URL of the file in the document library. If you want to have an ...
user avatar
  • 30.2k
3 votes
Accepted

Enable SPFx extension on a document based on specific content type

It is not supported currently. The List View commandset extension currently supports RegistrationType="List" and RegistrationId="100" which is the list template ID. References - Command Set ...
user avatar
  • 30.2k
3 votes
Accepted

SPFX apply styles before page renders

The problem you're having is that the loadCss method doesn't return a Promise or anything you can block on (in comparison loadScript does). So during runtime it starts to go get the css file and moves ...
user avatar
  • 555
3 votes
Accepted

Retrieve column value (page property) by site ID from Site Pages list

You are on the right track. Based on the code that you posted in the question, am assuming that you are using pnpjs. Using that, we can get the page properties as below: pnp.sp.web.lists.getById(...
user avatar
  • 30.2k

Only top scored, non community-wiki answers of a minimum length are eligible