17 votes
Accepted

How to retrieve pageContext in SPFx?

this.context.pageContext is available on render() method within top level class that extends BaseClientSideWebPart. Simply pass this.context as a props of to HelloWorld.tsx to reuse it. Sample (...
user avatar
  • 363
10 votes
Accepted

PowerApps and Flow vs SharePoint Framework

Very interesting question.. let us first understand the background of what is all 3 about. MSFlow - To Automate a business process we generally use workflows. Ms flow are alternative to workflows. ...
user avatar
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,358
9 votes
Accepted

Hide/Disable property pane component based on another component's value

You can make use of a standard boolean check to determine whether your toggle component has value. Based on that, you can show/hide your slider component. You can do this bool check in the ...
user avatar
  • 30.3k
9 votes
Accepted

SPFx calls blocked by CORS policy

The difference between jquery call and the native httclient call is a method of making http asynchronous request. jquery uses old good xhr, but httpclient uses modern fetch api. When making CORS ...
user avatar
8 votes

How to use SharePoint FrameWork for SharePoint 2016 on premise

To be able to use SPFX for SharePoint Server 2016, you must first patch you SharePoint Server 2016 with Feature Pack 2 (September 2017 Public Update for SharePoint 2016). Once it installed, you will ...
user avatar
7 votes
Accepted

SPFX: How to add item in SharePoint list with attachment?

Ronak, Working with attachments can be frustrating, but I have found that using the awesome PnP library makes it easy. Here's a quick summary of how to do it: Install the sp-pnp-js library by using ...
user avatar
  • 1,156
7 votes
Accepted

SPFX Gulp Serve for a wepart is not opening workbench

This is happening because your SPFx solution has an extension added to it. Whenever you add SPFx extension to the solution, after running the yeoman generator, it will modify the config > serve....
user avatar
  • 30.3k
6 votes
Accepted

Deploying a SPFx webpart to multiple tenants without public cdn

Currently there's no way to deploy a SPFx web part using a private CDN. Private CDN's URL is not static - which is a strict requirement for SPFx web parts. Your best shot would be to convince your ...
user avatar
  • 5,219
6 votes

SPX and Typescript - how to add references to SP.JS?

The SPFx Examples are a place to learn SPFx https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples Alas they hardly have documentation, and some archaic code patterns cry for a code ...
user avatar
6 votes

How to retrieve pageContext in SPFx?

It is better to use correct type WebPartContext instead of any. Don't forget to put namespace. import { WebPartContext } from '@microsoft/sp-webpart-base'; export interface WebPartProps { context:...
user avatar
6 votes
Accepted

Script to add SPFx webpart to a classic page using PnP Powershell

You can follow the below mentioned steps and after that you will be able to add your webpart to a classic page. 1) Go to your SharePoint workbench page (i.e https://tenant.sharepoint.com/sites/test/...
user avatar
  • 30.3k
5 votes

Typescript errors in SharePoint Framework webparts

Recent changes in lodash module made it incompatible with typescript 2.0.x. You can either upgrade typescript to 2.1.5 by running npm install typescript --save-dev or install previous definitions ...
user avatar
5 votes
Accepted

SPFx(On-Prem) - Property for single choice of Office-IU-Fabric - PeoplePicker

In the office fabric UI, we have a property itemLimit that you can use to restrict the selection to a single person. So, you need to modify it as below: public render(): React.ReactElement<...
user avatar
  • 30.3k
5 votes
Accepted

Send an email with SPHttpClient

You need to add an additional header, odata-version and set it to 3. This error happens because SPFx's built-in SPHttpClient uses the odata-version header whose value is set to 4. So, simply ...
user avatar
  • 30.3k
4 votes

SharePoint Framework Typescript typings

Adding external libraries with a CDN (such as jQuery) to an SPFx project can be broken down into a few parts: Saving the types (for jQuery navigate to the folder through cmd, then put npm install --...
user avatar
  • 136
4 votes
Accepted

Close propertyPane in sharepoint framework

Yeah, no good option available right now to close the property pane via API. But then you can use document.querySelector to find the close button element and then programmatically trigger the click ...
user avatar
  • 30.3k
4 votes
Accepted

Restrict audience for SharePoint Framework Solutions

You can restrict it to individual site collections by using the Site Collection app catalog which will ensure that SPFx webparts are only available in that specific site collection Target audiences ...
user avatar
  • 30.3k
4 votes
Accepted

Issues Loading External JS Library from CDN in a SharePoint Framework (SPFX) Web Part

Your external entry is correct. However, you should reference it in your code like this: var statuspage:any = require('StatusPage');
user avatar
  • 5,358
4 votes
Accepted

Office UI Fabric Dropdown event onChange not working

I do observe the same here. Interestingly, the deprecated onChanged event fires and not onChange. Works if extending a basecomponent and something is missing while extending React.Component. In the ...
user avatar
4 votes
Accepted

Create document set with REST API in SharePoint Framework

You need to make 2 HTTP requests to get it working. 1st request will get the content type Id of the document set content type present in the SharePoint document library. 2nd will make use of the ...
user avatar
  • 30.3k
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

SharePoint Framework: Loading icon in property pane

A little late to this answer, but you can follow the below approach: 1) Create 2 private variables, _listOptions of type IPropertyPaneDropdownOption and loadingIndicator of type boolean (set it to ...
user avatar
  • 30.3k
3 votes
Accepted

Get SharePoint List Items using SharePoint Framework React

There will be return type ISplistitemsState instead of void in Splistitems class. Change following line export default class Splistitems extends React.Component<ISplistitemsProps, void> { To ...
user avatar
  • 485
3 votes

SPX and Typescript - how to add references to SP.JS?

There is a specific guidance article describing how to use SharePoint JSOM with SharePoint Framework client-side web parts available at https://dev.office.com/sharepoint/docs/spfx/web-parts/guidance/...
user avatar
3 votes
Accepted

Typescript errors in SharePoint Framework webparts

In the screenshot, i see that you are running the Node v6.9.4 . You should uninstall this Node version and instead install the Node v4.6.0 LTS version. Today SharePoint Framework requires Node.js 4.6....
user avatar
  • 30.3k
3 votes
Accepted

SPFx - How to start workflow on list?

You can create a custom button to start a workflow on a List item. Here I have used SP services to achieve this. The whole logic lies in - how create a Url that redirects to Workflow initiation page? ...
user avatar
  • 2,317
3 votes
Accepted

Is it possible to set a Person or Group field through the REST API when the user is not listed on /sites/mysite/_api/web/siteusers?

If you want a reference to a SP.User stored on a SP.ListItem the user must exist in the SP.UserCollection siteusers of the specific SP.Web (i.e. tenant.sharepoint.com/sites/web/subweb/_api/web/...
user avatar
  • 2,321
3 votes
Accepted

Sharepoint framework experience. React or Angular?

I think this article may give you some directions: http://www.andrewconnell.com/blog/angular-react-or-vue-which-web-framework-to-focus-on-for-spfx The author does not choose one above the other, but ...
user avatar
  • 146
3 votes

SPFx(On-Prem) - Property for single choice of Office-IU-Fabric - PeoplePicker

You can use onResolveSuggestions. public render() { const suggestionProps: IBasePickerSuggestionsProps = { suggestionsHeaderText: 'Suggested People', noResultsFoundText: 'No results found', ...
user avatar

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